A Flash Developer Resource Site

Results 1 to 2 of 2
  1. #1
    Senior Member
    Join Date
    Sep 2002

    Cannot bring var to _root

    This is the situation:
    I have several MCs into one another(4) and a button at the bottom of all of them.
    The button is supposed to bring up a value contained into a textbox down there up to _root.textbox_variable

    Like this:

    But it doesnt work. It only works when I have the textbox one level below _root. like this:

    As if I cannot go to _root but yes to _root.Sub
    Any clue?
    Thanks again for the help.

  2. #2
    general rule bender Gloomycus's Avatar
    Join Date
    Nov 2000
    ontario canada
    Because the variables exist inside the movie clips, you have to target them on the movie clips. The problem that you were having with your original script was that you were targeting variables on the main time line that don't affect anything inside your movieclips. Your second script is more correct. An alternative solution to get what you want is inside each movieclip have a script like so

    onClipEvent(enterFrame) {
      myvar = _root.myvar;
    This will pull the variables off the _root timeline and subsititute those variables into your movie clips.

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

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.