# Removing movie clips from the timeline with AS 3.0

**URL:** <https://forum.kirupa.com/t/removing-movie-clips-from-the-timeline-with-as-3-0/234885>\
**Category:** flash\
**Created:** [August 6, 2007, 11:25pm UTC](https://forum.kirupa.com/t/removing-movie-clips-from-the-timeline-with-as-3-0/234885 "2007-08-06T23:25:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![thebooboo](https://avatars.discourse-cdn.com/v4/letter/t/898d66/32.png) [@thebooboo](https://forum.kirupa.com/u/thebooboo)\
**Post date:** [August 6, 2007, 11:25pm UTC](https://forum.kirupa.com/t/removing-movie-clips-from-the-timeline-with-as-3-0/234885/1 "2007-08-06T23:25:59Z")

</div>

Try this test:

Creat a new Flash movie with 2 bank keyframes.

Draw a rectangle on the first frame, convert it to a movieclip and give it an instance name of testSym

Add this code to the first frame:

////////////////////////////

removeChild(testSym);

testSym = null;

/////////////////////////

and then this code to the second frame:

//////////////////////

trace (“FORCING GC”);  
try {  
new LocalConnection().connect(‘foo’);  
new LocalConnection().connect(‘foo’);  
} catch (e:\*) {}  
stop();

// this forces the garbage collector but is not recommended for published products  
///////////////////////

give the rectangle movie clip 2 blank keyframes too. Put this code in the first frame:

///////////////////

trace(“I’m still here”);

/////////////////////

and this code in the second:

///////////////////

gotoAndPlay(1);

///////////////////

Now run the movie - I assumed that the clip would be marked for garbage collection and collected by the forced collect, but it still persists - presumably because it was put statically on the timeline?

Is there any way around this? Surely there must be a way to remove movie clips that have been placed statically on the timeline at design time rather than adding everything using code? Can anyone help?
