YH = 100;
FH = 9000;
YM = 10;
if(YM < 1){
_root.magic.gotoAndStop(2);
}
I want the attack button for the magic attack to be disabled once "YM" has reached 0. Therefore, I changed the button into a movie clip with frame 1 as the button and frame 2 without the button. I gave the movie clip the instance name of "magic". The button's code is:
on (release) {
_root.FH -= 300;
_root.YM -= 1;
}
When I start the movie, and click the magic attack button, the "FH" text decreases by 300 and "YM" decreases by 1 as it should. However, when "YM" is below 1, the movie clip instance "magic" does not go to frame 2. Yet, if I change the frame's code to start "YM" at 0, the movie clip goes to frame 2. For some reason, the "if" statement does not recognize that the variable changes, and only applies to the initial variable. Can you help me figure out what the problem is?
Edited by Blue_Monkey, 18 January 2008 - 05:45 PM.
