Flash removeChild after few seconds
-
27-10-2019 - |
Question
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()
And at the end it would be looking like this:
setTimeOut ( removeClip, 2000, clip );
function removeClip ( clip : DisplayObject ) : void
{
removeChild ( clip );
}
OTHER TIPS
Use the Timer class. Also the TweenLite library has a nice function called TweenLite.delayedCall(secondsDelay, functionToCall)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow