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<=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<=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<=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<=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?