# Typeof duplicate output

**URL:** <https://forum.kirupa.com/t/typeof-duplicate-output/232176>\
**Category:** Uncategorized\
**Created:** [July 11, 2007, 6:20pm UTC](https://forum.kirupa.com/t/typeof-duplicate-output/232176 "2007-07-11T18:20:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ollu](https://avatars.discourse-cdn.com/v4/letter/o/ee59a6/32.png) [@ollu](https://forum.kirupa.com/u/ollu)\
**Post date:** [July 11, 2007, 6:20pm UTC](https://forum.kirupa.com/t/typeof-duplicate-output/232176/1 "2007-07-11T18:20:15Z")

</div>

Hi,

I’m curious, I’ve been testing how to search for specific movieclip on stage and came a cross the typeof operator.  
So my test was creating ten movieclips on stage and then trace them with a for loop, like this:

```php

var count:Number = 10;
for (var i = 0; i<count; i++) {
    attachMovie("myMC", "my"+i+"_mc", this.getNextHighestDepth());
    var my_mc:MovieClip = _root["my"+i+"_mc"];
    my_mc._x = 5+40*i;
    my_mc._y = 5;
    my_mc.id = i;
    my_mc.nmb_txt.text = i;
}
my_btn.onRelease = function() {
    for (var prop in _root) {
        if (typeof _root[prop] == "movieclip") {
            myNmb_txt.text += " "+_root[prop].id;
        }
    }
};

```

When I run this I get as expected ten movieclips on the stage, but when the typeof loop runs the output is:  
“9 9 8 7 6 5 4 3 2 1 0”.

So my question is, where did the duplicate “9” come from?

Regards, Ollu
