_global?

If I set my “_global” like this:

_global.button.gettingStarted2 = true;

I thought I’d be able to clear it like this:

            for (var button in _global) delete _global[button];

But it’s not working. Does that "clear"statement look correct?

What’s wrong here?

Thanks!

dont use “button” Its already a keyword (object) in Flash. A button is a Flash button - the Button object. You can’t (nor would you want to) delete that.

BUT… if I use another word it should work fine, right?

also, there is no need to use a for…in loop. You can just simply say delete global.button

Now my "_globals’ straight up quit working. Here’s what I’m doing…

BUTTON

on (release){
delete _global.navButtons
_global.navButtons.gettingStarted2 = true;

FRAME

this.onEnterFrame = function() {
if (navButtons.computerSetup2) {
this.gotoAndStop(10);
} else {
this.prevFrame();
}
}
};

Shouldn’t that work? Am I calling my “_global” the right way? It actually worked before I started putting all the “navButtons” with the “_global”…

delete _global.navButtons
_global.navButtons.gettingStarted2 = true;

^ how can you expect to assign gettingStarted2 in navButtons if you just deleted navButtons?

Well… I did that to clear the _global to turn all the buttons off, then assign that one button on.

Know what I mean? Should I do it another way?

It’s been working fine till I put “navButtons” into the equation.