# \_global?

**URL:** <https://forum.kirupa.com/t/-global/29080>\
**Category:** Uncategorized\
**Created:** [August 21, 2003, 10:25pm UTC](https://forum.kirupa.com/t/-global/29080 "2003-08-21T22:25:57Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![earph](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/earph/32/79_2.png) [@earph](https://forum.kirupa.com/u/earph)\
**Post date:** [August 21, 2003, 10:25pm UTC](https://forum.kirupa.com/t/-global/29080/1 "2003-08-21T22:25:57Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 21, 2003, 10:56pm UTC](https://forum.kirupa.com/t/-global/29080/2 "2003-08-21T22:56:00Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 21, 2003, 11:58pm UTC](https://forum.kirupa.com/t/-global/29080/3 "2003-08-21T23:58:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 22, 2003, 9:14am UTC](https://forum.kirupa.com/t/-global/29080/4 "2003-08-22T09:14:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 22, 2003, 3:15pm UTC](https://forum.kirupa.com/t/-global/29080/5 "2003-08-22T15:15:15Z")

</div>

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”…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 22, 2003, 3:18pm UTC](https://forum.kirupa.com/t/-global/29080/6 "2003-08-22T15:18:25Z")

</div>

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

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 22, 2003, 3:21pm UTC](https://forum.kirupa.com/t/-global/29080/7 "2003-08-22T15:21:01Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 22, 2003, 3:21pm UTC](https://forum.kirupa.com/t/-global/29080/8 "2003-08-22T15:21:42Z")

</div>

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