A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: variable won't update from higher level into root

  1. #1
    Junior Member
    Join Date
    May 2001
    Posts
    17
    Hey
    I am making search game. If the player has found all missing object a new page will load were they can download a song.
    The problem is that I can't get the variable "allFound" update.

    _level0:
    frame 1: allFound = 0;
    frame 2: some other code;
    frane 3: gotoAndPlay(2);

    _levelx:
    onmouse release;
    _root._level0.allFound = allFound+1;

    It updates the allFound variable only ones.

    I tried testing it with buttons wich are in level one and that works.
    Why doesn't it work from a higher level into the root?

    can anyone help me?

  2. #2
    Senior Member
    Join Date
    Aug 2000
    Posts
    264
    I think you should take out _root as this specifies the host _root and not the _level._root ie:


    _level0:
    frame 1: allFound = 0;
    frame 2: some other code;
    frane 3: gotoAndPlay(2);

    _levelx:
    on (release){
    _level0.allFound++;
    }


  3. #3
    Junior Member
    Join Date
    May 2001
    Posts
    17

    Thanks for helping me

    You were right about leaving out the root.
    The second thing I did was changing the code
    _level0.allFound = allFound+1;

    into:
    _level0.allFound = _level0.allFound+1

    Using the ++ command didn't work

    Thanks again for your help. Seeing new options always creates solutions.

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