Welcome visitor
* Login
* Register
It is currently May 24th, 2019, 5:08 pm
All times are UTC [ DST ]
* Search
View unanswered posts - View active topics

FORUMS » Flash / ActionScript » ActionScript 3.0



Post new topic Reply to topic  [ 3 posts ] 
Author Message
  Remove ALL childs
PostPosted: February 10th, 2009, 8:50 pm 
User avatar

Posts: 48
Hi,
what im doing is that on frame 2 i want to get the stage clear from all the images i loaded on frame 1. this is what im using but it only removes one picture
removeChild(imageLoader);


Top
 Profile  
 
  Re: Remove ALL childs
PostPosted: February 10th, 2009, 8:53 pm 
User avatar

Posts: 61
The reason it is not working as you want is that you are only removing one loader, you will need to do some loop to remove all the childs.


Top
 Profile  
 
  Re: Remove ALL childs
PostPosted: February 10th, 2009, 8:55 pm 
User avatar

Posts: 112
try this loop
public function removeAllChildrens(displayObject:DisplayObjectContainer):void
        {
            var i:int = displayObject.numChildren;
            while(i--)
            {
                displayObject.removeChildAt(i);
            }
        }


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

FORUMS » Flash / ActionScript » ActionScript 3.0


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron