Search code examples
actionscript-3flash-cs5removechildaddchild

Flash removeChild after few seconds


I'm new on Flash, i don't know if it possible, but i'm adding a random movieclip to the stage, using addChild, and i need to remove them after 10 seconds...how can i do this using removeChild?

regards


Solution

  • Or you can use the default function from flash library

    setTimeOut()
    

    More Info.

    And at the end it would be looking like this:

    setTimeOut ( removeClip, 2000, clip );
    
    function removeClip ( clip : DisplayObject ) : void
    {
        removeChild ( clip );
    }