PDA

View Full Version : Trying to "kill" children, not remove them.



tonythemediaguy
October 7th, 2007, 05:55 PM
Hi,

I'm dynamically building out a menu using Sprites and a couple layers of children. The sprites are built out using a function. When I remove a child, it doesn't "kill" the child, it only makes it not in the Display List. How do I completely remove a child (sprite) from it's parent?

Thanks!

Tony

Rezmason
October 7th, 2007, 05:59 PM
Taken out of context, this thread's title is horrendous.

If you have a dynamically generated object, setting all references to it to null will cast it into oblivion... at an indeterminate time in the future. For instance!


var s:Sprite = new Sprite;
s = null; // bye bye, Sprite

tonythemediaguy
October 7th, 2007, 06:45 PM
Thank You!! You just helped me kill my children!

Rezmason
October 7th, 2007, 09:30 PM
:pa:

zellers
October 8th, 2007, 02:04 AM
lol @ the thread title. I didn't know what you were talking about at first.

brndn
October 8th, 2007, 11:00 AM
red alert at goggle. expect a phone call.:huh: hahaha