Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > General > Gaming and Game Development

Reply
 
Thread Tools Rate Thread Display Modes
Old 02-16-2009, 03:52 PM   #1
rapidbushnell
Registered User
 
Join Date: Jan 2009
Posts: 15
Default [AS3] delete instance from movie

in my game i addChild(enemy) and when you click the enemy it kills it. eventually these children will pile up in my movie. removeChild(enemy) removes them from view. How do i delete these from the movie so they dont pile up?
rapidbushnell is offline   Reply With Quote
Old 02-16-2009, 03:58 PM   #2
dimpiax
Senior Member
 
dimpiax's Avatar
 
Join Date: Mar 2008
Location: Ukraine, Kiev
Posts: 113
Send a message via Skype™ to dimpiax
Default

ActionScript Code:
super.removeChild(_enemy); // remove from display list _enemy.removeEventListener(...); // u must remove all enemy's listeners _enemy = null; // remove from memory
dimpiax is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Best method for: movie A loading B or movie B loading A? BluegillMedia ActionScript 2.0 2 04-16-2008 08:38 PM
gotoAndPlay a movie instance arch691 ActionScript 2.0 3 02-20-2008 09:17 PM
drag and drop from a movie instance batgirl_sa ActionScript 1.0 (and below) 0 09-03-2005 10:24 AM
Detecting collision of 2 movie clips problem talie ActionScript 2.0 0 07-22-2005 06:07 AM
Children of movie clip instance jlh Simple Stuff (Newbies) 2 04-24-2003 11:09 AM


All times are GMT. The time now is 03:27 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.