# Can't remove movieclips in an array

**URL:** <https://forum.kirupa.com/t/cant-remove-movieclips-in-an-array/240395>\
**Category:** flash\
**Created:** [October 2, 2007, 5:09pm UTC](https://forum.kirupa.com/t/cant-remove-movieclips-in-an-array/240395 "2007-10-02T17:09:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mario\_hater](https://avatars.discourse-cdn.com/v4/letter/m/e0b2c6/32.png) [@mario\_hater](https://forum.kirupa.com/u/mario_hater)\
**Post date:** [October 2, 2007, 5:09pm UTC](https://forum.kirupa.com/t/cant-remove-movieclips-in-an-array/240395/1 "2007-10-02T17:09:26Z")

</div>

I have made 4 arrays and filled the with movieclips using the array.push(movieclip) method. I have then made a function that is supposed to remove everything in those arrays. This is the code for it:

```
ActionScript Code:
[FONT=Courier New][LEFT][COLOR=#000000] **function** [/COLOR] removestuff[COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
[COLOR=#0000FF]removeMovieClip[/COLOR][COLOR=#000000]([/COLOR]p1s[COLOR=#000000])[/COLOR];
[COLOR=#0000FF]removeMovieClip[/COLOR][COLOR=#000000]([/COLOR]p2s[COLOR=#000000])[/COLOR];
[COLOR=#0000FF]removeMovieClip[/COLOR][COLOR=#000000]([/COLOR]p3s[COLOR=#000000])[/COLOR];
[COLOR=#0000FF]removeMovieClip[/COLOR][COLOR=#000000]([/COLOR]p4s[COLOR=#000000])[/COLOR];
[COLOR=#0000FF]for[/COLOR] [COLOR=#000000]([/COLOR]s=[COLOR=#000080]0[/COLOR]; s&lt;=exs.[COLOR=#0000FF]length[/COLOR]; s++[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
    [COLOR=#0000FF]removeMovieClip[/COLOR][COLOR=#000000]([/COLOR]exs[COLOR=#000000][[/COLOR]s[COLOR=#000000]][/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#000000]}[/COLOR]
[COLOR=#0000FF]for[/COLOR] [COLOR=#000000]([/COLOR]s=[COLOR=#000080]0[/COLOR]; s&lt;=bullets.[COLOR=#0000FF]length[/COLOR]; s++[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
    [COLOR=#0000FF]removeMovieClip[/COLOR][COLOR=#000000]([/COLOR]bullets[COLOR=#000000][[/COLOR]s[COLOR=#000000]][/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#000000]}[/COLOR]
[COLOR=#0000FF]for[/COLOR] [COLOR=#000000]([/COLOR]s=[COLOR=#000080]0[/COLOR]; s&lt;=bombs.[COLOR=#0000FF]length[/COLOR]; s++[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
    [COLOR=#0000FF]removeMovieClip[/COLOR][COLOR=#000000]([/COLOR]bombs[COLOR=#000000][[/COLOR]s[COLOR=#000000]][/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#000000]}[/COLOR]
[COLOR=#0000FF]for[/COLOR] [COLOR=#000000]([/COLOR]s=[COLOR=#000080]0[/COLOR]; s&lt;=stars.[COLOR=#0000FF]length[/COLOR]; s++[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
    [COLOR=#0000FF]removeMovieClip[/COLOR][COLOR=#000000]([/COLOR]stars[COLOR=#000000][[/COLOR]s[COLOR=#000000]][/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#000000]}[/COLOR]

```

[COLOR=#000000]}[/COLOR]  
[/LEFT]  
[/FONT]

But when I call this function it does nothing but remove p1s, p2s, p3s and p4s. Also when I type trace(s) in one of the for loops, it outputs 0 for some reason. Any ideas as to what I’m doing wrong?
