# Detecting or iterating through all movieclips within a on-stage movieclip

**URL:** <https://forum.kirupa.com/t/detecting-or-iterating-through-all-movieclips-within-a-on-stage-movieclip/254475>\
**Category:** flash\
**Created:** [March 12, 2008, 2:38pm UTC](https://forum.kirupa.com/t/detecting-or-iterating-through-all-movieclips-within-a-on-stage-movieclip/254475 "2008-03-12T14:38:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Glidias](https://avatars.discourse-cdn.com/v4/letter/g/e36b37/32.png) [@Glidias](https://forum.kirupa.com/u/Glidias)\
**Post date:** [March 12, 2008, 2:38pm UTC](https://forum.kirupa.com/t/detecting-or-iterating-through-all-movieclips-within-a-on-stage-movieclip/254475/1 "2008-03-12T14:38:48Z")

</div>

How to do this for on-stage MovieClips in authourng view (when they appear in the timeline).

I tried hacking the

```auto

MovieClip.prototype=function() {
   trace("detect existence of:"+this);
}
or
MovieClip.prototype.onLoad=function() {
   trace("detect existence of:"+this);
}

```

But it doesn’t work and onLoad only works if you load something through .swf. onUnload event does work though for the individual sub-mcs.

The only way I’ve seen is to do this.

```auto

MovieClip.prototype.onEnterFrame=function() {
    trace("detect existence of:"+this);
   this.onEnterFrame=null; // deleting this.onEnterFrame doesn't even work!!!
 }

```

So, what should i do? In Actionscript 3.0, i can simply iterate through the DisplayList. In As2.0, the depths of the on-stage authoring movieclips will not have any particular function to execute upon construction. So, how do i deetect them?
