PDA

View Full Version : How to reset the movie's stored Boolean values



setzer9999
April 20th, 2008, 02:42 AM
I learned how to use simple boolean values and define many of them in one movie as separate variables from jon_bla and glosrfc. Thank you to those two again.

I am missing one portion of the puzzle now in order to know how to make this style of dynamic movie menu work.

1. I have 3 buttons on frame 1, each one pertaining to a Boolean value.

2. The code on each button is:


//button 1
on(press){
gotoAndPlay(2);
var skip1:Boolean = new Boolean();
skip1=true;
}

//button2
on(press){
gotoAndPlay(2);
var skip2:Boolean = new Boolean();
skip2=true;
}

//button3
on(press){
gotoAndPlay(2);
var skip3:Boolean = new Boolean();
skip3=true;
}


3. There is a tween from frame 2 through frame 8

4. On frame 8 there is the following code:



stop();
if(skip1 == true){
gotoAndPlay(15);
}

if(skip2 == true){
gotoAndPlay(22);
}

if(skip3 == true){
gotoAndPlay(29);
}


4. I have another set of code I don't need to describe later in the movie that brings the movie back to frame 1.

The problem is, once button 2 and therefore skip2 has been activated, if I attempt to click on button 1 after that, the movie still activates the Boolean value skip2. The same thing happens if I activate skip3, except now the movie activates skip3 no matter which button is pressed.

My question is, how do I reset the movie's recognition of the satisfied conditions for the Boolean values? How can I make it think no Boolean variables have been activated once it is set back to frame 1 without having to reload the movie entirely?

setzer9999
April 20th, 2008, 03:39 AM
Sorry for double posting, but I figured it out. I discovered the "delete" function for variables. If anyone has another way of reseting variables without having to list each one, that would still be something I'd like to know too. Thanks everybody.

glosrfc
April 20th, 2008, 09:28 AM
I'd strongly recommend that you reconsider your approach:
http://www.kirupa.com/forum/showpost.php?p=2315115&postcount=3
http://www.kirupa.com/forum/showpost.php?p=2315115&postcount=5

Things are likely to get very complex otherwise, especially as you intend to add at least another 9 buttons.