# Flash MX variable problem

**URL:** <https://forum.kirupa.com/t/flash-mx-variable-problem/115940>\
**Category:** Uncategorized\
**Created:** [July 13, 2004, 6:00am UTC](https://forum.kirupa.com/t/flash-mx-variable-problem/115940 "2004-07-13T06:00:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SandMan27](https://avatars.discourse-cdn.com/v4/letter/s/96bed5/32.png) [@SandMan27](https://forum.kirupa.com/u/SandMan27)\
**Post date:** [July 13, 2004, 6:00am UTC](https://forum.kirupa.com/t/flash-mx-variable-problem/115940/1 "2004-07-13T06:00:05Z")

</div>

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 😛 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?
