How to add a delay to a loop?


i want repeatedly add movie stage using add child have created loop add 30 times. how can make aren't added @ same time. i'd able set interval of time between them being added.

thanks.

something do:

var atimer:timer = new timer(500,30);
atimer.addeventlistener(timerevent.timer,addone);
atimer.start();

function addone(e:timerevent){
var anmc:mymovieclip = new mymovieclip();
addchild(anmc);
}

as stands movieclips ("mymovieclip" name used when set symbol sharing in library) added every half second, on top of each other. want set anmc.x , anmc.y position need before doing addchild().

the event has property called currentcount, use figure out 1 gets placed. like:

anmc.x = e.currentcount * 20;

would spread 30 movieclips across stage, 20 pixels further along each time.




More discussions in ActionScript 3


adobe

Comments

Popular posts from this blog

Convierte tu Raspberry en un NAS. Firmware fvdw-sl 15.3 - Raspberry Pi Forums

How to format a Get Request

avrdude: verification error, first mismatch at byte 0x0000 0x0c != 0x62