# \_global not acting as global variable

**URL:** <https://forum.kirupa.com/t/-global-not-acting-as-global-variable/50009>\
**Category:** flash\
**Created:** [April 28, 2004, 5:19pm UTC](https://forum.kirupa.com/t/-global-not-acting-as-global-variable/50009 "2004-04-28T17:19:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sandman9](https://avatars.discourse-cdn.com/v4/letter/s/6a8cbe/32.png) [@Sandman9](https://forum.kirupa.com/u/Sandman9)\
**Post date:** [April 28, 2004, 5:19pm UTC](https://forum.kirupa.com/t/-global-not-acting-as-global-variable/50009/1 "2004-04-28T17:19:12Z")

</div>

I have a button on my timeline which moves an object on release. On Press it says \_global.flag=2; … then there’s a MC on this same timeline. In this MC I have an if statement saying

```auto

if (_global.flag ==2) {
    gotoAndStop(1);
}

```

Although this MC does not go to and stop on frame one. Also I used trace(flag) inside this MC and it’s not showing anything. I used \_global because the on press script is inside a button on my timeline and the if statement is inside a MC which is on the same timeline as the button is on

Sandman9
