Access Flash Symbol Via Code from an .as Class

Posted by David on Stack Overflow See other posts from Stack Overflow or by David
Published on 2010-04-03T18:50:04Z Indexed on 2010/04/03 18:53 UTC
Read the original article Hit count: 281

Filed under:
|

Hi,

I've got a movie clip symbol in my .fla file that I need to reference in an .as file which is in a subfolder in the project. I select the symbol in the library and edit its properties. Its name is bubble; I Export for ActionScript and Export in frame 1. I give it a class name of Bubble.

Now I need to go to my .as class, called SomeClass.as

There, I need to reference the symbol, because I want to move it from within related code in that .as file. But if I try bubble.x I get an error. If I try var myBubble:Bubble = new Bubble(); I get 'Access of undefined property myBubble'.

I was told that I might try 'importing the document class' but how do you import a class which is in the root directory of your app from within a class that's in a subfolder? (Don't know if this would provide the solution anyway)...

Tanks.

© Stack Overflow or respective owner

Related posts about flash-cs4

Related posts about symbols