earph
August 21, 2003, 10:25pm
1
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!
system
August 21, 2003, 10:56pm
2
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.
system
August 21, 2003, 11:58pm
3
BUT… if I use another word it should work fine, right?
system
August 22, 2003, 9:14am
4
also, there is no need to use a for…in loop. You can just simply say delete global.button
system
August 22, 2003, 3:15pm
5
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”…
system
August 22, 2003, 3:18pm
6
delete _global.navButtons
_global.navButtons.gettingStarted2 = true;
^ how can you expect to assign gettingStarted2 in navButtons if you just deleted navButtons?
system
August 22, 2003, 3:21pm
7
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?
system
August 22, 2003, 3:21pm
8
It’s been working fine till I put “navButtons” into the equation.