So now that I’ve been teaching Flash for a few months, I’ve noticed something about the most recent version of Flash that’s totally confusing for a beginner and I’ve had to sort it out more than once:
In the picture above, Instance of means that the above item is an instance (a concrete version of) the class called Example.
The instance name is not Example! Really, Adobe should just take out the words Instance of . No one sees the word “of” – they just see the word “Instance”.
The instance name actually goes where it says Instance Name.
The next equally stupid thing is the button beside where you can enter the Instance Name:
Clicking on the Actionscript panel button will take you to an Actionscript panel where you aren’t allowed to enter any code!
If you are a designer or a developer/designer, you might be still using the Flash IDE (instead of Flex) and so, from time to time, you’re still using “instances” on the stage.
However, if you’re a designer that works with developers, you will probably be asked to turn off the setting, “Automatically declare stage instances“.
Once you uncheck this box, in your class file you have to create a public variable with the same name as your instance:
public var my_graphic_that_is_on_stage:Star = new Star;
If you make this private instead of public, you will get the following nasty error:
ReferenceError: Error #1056: Cannot create property
my_graphic_that_is_on_stage on MyLoadedMovieClip.