_global not acting as global variable

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


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