# Variable Trouble

**URL:** <https://forum.kirupa.com/t/variable-trouble/37020>\
**Category:** flash\
**Created:** [December 4, 2003, 9:16pm UTC](https://forum.kirupa.com/t/variable-trouble/37020 "2003-12-04T21:16:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jondj24](https://avatars.discourse-cdn.com/v4/letter/j/5f9b8f/32.png) [@jondj24](https://forum.kirupa.com/u/jondj24)\
**Post date:** [December 4, 2003, 9:16pm UTC](https://forum.kirupa.com/t/variable-trouble/37020/1 "2003-12-04T21:16:48Z")

</div>

hello hello.  
i was wondering if i set a variable on a button (the button is on level 5)

```auto

_level5.current_selection = "credits"

```

and i would like the movie on level 1 to recognize that this button (on level 5)has been pressed,  
is this script correct on an empty keyframe in level 1.

```auto

_level5.current_selection = "credits";
if (_level5.current_selection == "credits") {
    loadMovieNum("credits.swf", 2);
} else {
    gotoAndPlay(1);
    _level5.current_selection = "credits";
}

```

i’ve tried this and it isn’t recognizing the variable.  
please help. thanks
