# Running function on non-typed non-movie clip object

**URL:** <https://forum.kirupa.com/t/running-function-on-non-typed-non-movie-clip-object/312757>\
**Category:** Uncategorized\
**Created:** [August 12, 2010, 2:21am UTC](https://forum.kirupa.com/t/running-function-on-non-typed-non-movie-clip-object/312757 "2010-08-12T02:21:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shaedo](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@Shaedo](https://forum.kirupa.com/u/Shaedo)\
**Post date:** [August 12, 2010, 2:21am UTC](https://forum.kirupa.com/t/running-function-on-non-typed-non-movie-clip-object/312757/1 "2010-08-12T02:21:06Z")

</div>

I am loading various swf library component/classes during run time.  
All of these components have the function ‘remove()’ in them.  
Not all of these components are MovieClips, many extend Sprite instead.  
I have them in an array that I loop through and call remove() on each of them.

I would like to keep strict mode on if at all possible:

Usually I can just do this

```auto
for(i=0;i<a.length;i++)
{
MovieClip(i).remove();
}

```

but I am wondering what happens if I type a class that extends Sprite as a MovieClip to avoid the compile time error in order to call the remove function on it?

remove() does things like remove all listeners, stop sounds playing etc and finally parent.removeChild(this);

Thank you for taking the time to look at my problem. I am really just after opinions on this one.
