# Hey ieatcotton... question!

**URL:** https://forum.kirupa.com/t/hey-ieatcotton-question/191631
**Category:** flash
**Created:** [June 21, 2006, 9:51pm UTC](https://forum.kirupa.com/t/hey-ieatcotton-question/191631 "2006-06-21T21:51:49Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Anogar](https://avatars.discourse-cdn.com/v4/letter/a/ed655f/32.png) [@Anogar](https://forum.kirupa.com/u/Anogar)
#### Post date: [June 21, 2006, 9:51pm UTC](https://forum.kirupa.com/t/hey-ieatcotton-question/191631/1 "2006-06-21T21:51:49Z")

</div>

[FONT=Courier New] [/FONT]

```auto

for (var object in _root) {
            if (_root[object] instanceof Button || _root[object] instanceof MovieClip) {
                _root[object].enabled = true;
            }
        }

```

This is good code that you wrote. I added the additional or statement so that it would kill my movieclips too. Would you mind going through and explaining it? I’m not quite sure I understand, but let me try.

for (var object in \_root) {

Alright, so, it declares the variable ‘object’ and places it at the ‘\_root’ location, and executes the following:

if (\_root[object] instanceof Button){

Huh. So if this were alternately written as:

if (\_root[object] instanceof Button = true)

would that be the same thing?

\_root[object].enabled = true;

Alright, this declares the object’s enabled value to be true… I guess I don’t get how this works. I know what it does, but not how it works.

Sorry. Help?
