In Flash CS3, when you have instances (Movieclips) on the main timeline (Stage) with instance name on them and “Automatically declare stage instances” is off (File->Publish Setting->Flash->Actionscript 3.0 setting), You will need to declare properties for the document class with the same instance names or else you will get the error messages…
For example, if you have 2 movie clips named “box” and “circle” on the stage, in document class (Main), you will need to write like:
1 2 3 4 5 6 7 8 9 10 11 12 | package { // Import class import flash.display.*; // Main public class Main extends Sprite { // Properties public var box:MovieClip; public var circle:MovieClip; // Constructor function Main() {} } } |
The document class properties will need to be public too since the movie clips are on stage that is public accessible.
4 users commented in " AS3 ReferenceError: Error #1056 "
Follow-up comment rss or Leave a Trackback[...] discovered here Quote: In Flash CS3, when you have instances (Movieclips) on the main timeline (Stage) with [...]
Symboles liés et LoaderContext…
Actuellement sur un gros projet, je me suis vu confronté à un souci du aux symboles graphiques héritant d’une classe et de leur utilisation dans un autre SWF. Et c’est la que survient l’erreur #1056 (ReferenceError) qui n’a (presque) aucun rappo…
This really helps.Especially the last sentence,thx.
Thanks very much for the tip… I’ve been fighting with this for like a hole hour without finding a good solution! =) Cheers…
Leave A Reply