N/APosted on - 06/20/2012
Maybe you could just give me the most definite answer of the main reason why a flash error occurs? Admittedly, I am just new to Action Script 3 and I have been troubled with some problems. I was able to create a project with a few simple classes using Flex builder 3.
At first it seems to have no problem when class A initiates an object of class B. It is then compiled finely but the problem is an error message: “Argument Error: Error #2012: B class cannot be instantiated” would appear even before it would run. What might be the cause of this?
What Causes Flash Error #2012 in Flex Builder 3?
Normally the errors that occur in the flash are due to something that is getting null in its parameters or is not performing correctly.
Using the try catch block usually works. However in your error, there is something else involved.
The class that you are trying to use as the child class is the subclass of an object that can be a Display object and it belongs to an abstract class.
The child class can never inherit the abstract class methods so you need to change it.
You have to change the child class into something else in order to tackle the problem that you are facing. It is just due to poor use of inheritance feature