PDA

View Full Version : How to remove child?



kadaj
May 19th, 2009, 09:08 AM
When beginning without any key pressed the ryustance_mc plays as it should.
When right or left key is pressed the ryuwalk_mc plays but the ryustance_mc plays at the background. How to remove it from the holder?
The thing is when I stop pressing any of the keys then ryustance_mc must play again.

function control(event:Event):void
{
if(rightKeyIsDown) {
holder_mc.addChild(ryuwalk_mc);
ryuwalk_mc.play();
holder_mc.x += speed;
}
if(leftKeyIsDown) {
holder_mc.addChild(ryuwalk_mc);
ryuwalk_mc.play();
holder_mc.x -= speed;
}
}


initializeGame();[/code]http://i42.tinypic.com/2utrh41.jpg


Please help me.
Thank You

kadaj
May 19th, 2009, 10:02 AM
Got it working and thanks goes to Dimonte (http://www.kirupa.com/forum/member.php?u=137801) from RemoveAllChildren post.

Any way to delete this post.
How to delete a post?