Flash MX variable problem

Ok, I’ve been working on this for hours and can’t figure it out.

I have a swf file that plays, and when a button is clicked it sets a global variable and loads a movie:
on (release) {
_global.gateStat=0;
loadMovieNum(“Security Cams.swf”, 5);
}

Now, in the loaded movie, there is a button that checks the global variable and acts accordingly. (this is just the code I’m using to try and get it to work. It would be more complex later :stuck_out_tongue: lol )

on (release){
if (_global.gateStat == 0) {
gotoAndPlay(5);
}

I’ve also tried

on (release){
if (gateStat == 0) {
gotoAndPlay(5);
}

with no luck. Any suggestions?

You want to play frame 5 of the main movie or the Security Cams movie?
If you want to target the main movie, use _root

_root.gotoAndPlay(5);

I want the security cams movie to go to frame 5, which it does without the if statement. The problem is, when I include the if statment it doesn’t seem to reconize the global variable. With that code running when I hit the button, it does nothing. If I remove the if and it’s just

on (release){

        gotoAndPlay(5);
        }

it runs fine, but once I add in the if with the variable check it doesn’t work anymore. Am I declaring it or assigning the value incorrectly?

ur missing a closing parenthesis:

on (release){
if (gateStat == 0) {
gotoAndPlay(5);
}

should be:

 on (release){
if (gateStat == 0) {
gotoAndPlay(5);
}
**}**

regards,

Prophet.