1 Reply Latest reply on Aug 1, 2008 11:15 AM by kglad

    Why does my variable value change?

    Level 1
      I've declared a variable on Frame 0 as follows (all code is on the same timeline, just different frames):

      var myVariable:Boolean = false;

      Also on Frame 0, I have a button that takes my to Frame 5 on which I change myVariable value as follows:

      myVariable = true;

      Also on Frame 5, I have a button that takes me back to Frame 0. When I click this button and return to frame 0, why does myVariable value change back to "false" again? Haven't I assigned it a value of "true" on Frame 5? Is the variable declared again and reassigned its inital value of "false" each time I enter Frame 0?

      How do I define this variable on Frame 0 so that when I change its value on Frame 5, the value remains changed when I return to Frame 0?

      Thank you!