Copy link to clipboard
Copied
I have a creaated a variable on the stage which is:
var coinCount:int;
and I want to call the coinCount variable to the coin class (external actionscript file). How can I do it?
Copy link to clipboard
Copied
that's poor coding. you shouldn't have any code on your timeline (except for stop,play and the goto's).
but if you want to do it and coin is a display object and has been added to the display list (eg, use a listener) and coinCount has been defined (ie, its frame has played) on the main timeline, you can use:
MovieClip(this.root).coinCount
Copy link to clipboard
Copied
thank u!! but I have found a method to use only the actionscript... so yea.. now I'm not using this method!!
Thanks though!!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now