Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

New Here ,
Mar 20, 2015 Mar 20, 2015

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?

TOPICS
ActionScript
177
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 21, 2015 Mar 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 21, 2015 Mar 21, 2015
LATEST

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

Thanks though!!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines