A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: How to make a movieclip reconize a global variable?

  1. #1
    Junior Member
    Join Date
    Oct 2015
    Posts
    2

    Question How to make a movieclip reconize a global variable?

    Im using as2 and in the main timeline i wrote:
    Code:
    var hp:Number=10;
    _global.hp;
    Then i put a dynamic text inside the movie clip with the variable, but it doesn't work. what do i have to do to make it work? The variable i did inside the movieclip works.

  2. #2
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    Have a look here, see if it helps you.

    http://www.kirupa.com/developer/acti...cks/global.htm

  3. #3
    Junior Member
    Join Date
    Oct 2015
    Posts
    2
    Thank you for the link, it helped. I wasnt refering to _global.varname on the dynamic text field, i also was using the _root._global.varname inside the movieclip timeline and not on the movieclip scrip.
    Last edited by Kaishonachi; 11-02-2015 at 06:45 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center