# Flex 3: delete instance of a component?

**URL:** <https://forum.kirupa.com/t/flex-3-delete-instance-of-a-component/266303>\
**Category:** flash\
**Created:** [July 18, 2008, 7:10am UTC](https://forum.kirupa.com/t/flex-3-delete-instance-of-a-component/266303 "2008-07-18T07:10:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![unhitched](https://avatars.discourse-cdn.com/v4/letter/u/b38774/32.png) [@unhitched](https://forum.kirupa.com/u/unhitched)\
**Post date:** [July 18, 2008, 7:10am UTC](https://forum.kirupa.com/t/flex-3-delete-instance-of-a-component/266303/1 "2008-07-18T07:10:28Z")

</div>

hey champs,

Hoping someone can help me out here as I’m having no luck with this prob…

I have a Flex 3 AIR app with a TileList which loads thumbnails & source strings for videos. When a thumb is selected and a button is pressed the videos launch in a new window.

onButtonPress:

// create a new window & play the selected clip  
private function playClip():void  
{  
if (clipDescription.length \> 0)  
{  
var vp:FLVPlayer = new FLVplayer()  
trace(“assets/flvs/”+galleryClipData.source);  
vp.open(false);  
vp.vidSource = (“assets/flvs/”+galleryClipData.source)  
vp.addEventListener(Event.CLOSE, closeClip, false, 0, true); //?  
}  
}

“FLVPlayer” is a subclass of mx:window and has an FLVPlayback component I customised in Flash and imported through a SWC.

Using Flex profiling, I can see that multiple instances of FLVPlayer and its children get created (and hog memory!) each time I play a thumb.

Can anyone tell me how I go about deleting the “vp:FLVPlayer” instance when the window is closed?

Any help would be much appreciated!

cheers
