Skip to main content
NameIsNothing
Participant
March 21, 2015
Question

How to call variables which are on stage into the external actionscript file (.as)?

  • March 21, 2015
  • 1 reply
  • 194 views

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?

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
March 21, 2015

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

NameIsNothing
Participant
March 21, 2015

thank u!! but I have found a method to use only the actionscript... so yea.. now I'm not using this method!!

Thanks though!!