Hi guys…
wondering if anyone knows if its possible to have a pause within a ‘for loop’ before it runs through the next loop?
heres the script i’ve built up so far, i’m running off other variables and arrays to pull in the logos and the animating in is working fine except that they all run in at the same time, basically what i want is that they would run one after the other with a 5 second gap between them…
heres what i have…
for(logocounter=0; logocounter<27; logocounter++){
if(boxcounter==1){
this.holder1.loadMovie(logos[logocounter]);
logocounter++;
trace(logos[logocounter]);
import mx.transitions.Tween;
var myTween:Tween = new Tween(holder1, “_x”, mx.transitions.easing.None.easeNone,400, endpoint1, 1, true);
trace(endpoint1+“this is endpoint1”);
trace(currentlogo+“this is currentlogo1”);
var boxcounter=2;
}
if(boxcounter==2){
logocounter++;
trace(logos[logocounter]);
this.holder2.loadMovie(logos[logocounter]);
var myTween:Tween = new Tween(holder2, “_x”, mx.transitions.easing.None.easeNone,400, endpoint2, 1, true);
trace(endpoint2+“this is endpoint2”);
trace(currentlogo+“this is currentlogo2”);
var boxcounter=3;
}
if(boxcounter==3){
logocounter++;
trace(logos[logocounter]);
this.holder3.loadMovie(logos[logocounter]);
var myTween:Tween = new Tween(holder3, “_x”, mx.transitions.easing.None.easeNone,400, endpoint3, 1, true);
trace(endpoint3+“this is endpoint3”);
trace(currentlogo+“this is currentlogo3”);
var boxcounter=4;
}
if(boxcounter==4){
logocounter++;
trace(logos[logocounter]);
this.holder4.loadMovie(logos[logocounter]);
var myTween:Tween = new Tween(holder4, “_x”, mx.transitions.easing.None.easeNone,400, endpoint4, 1, true);
trace(endpoint2+“this is endpoint4”);
trace(currentlogo+“this is currentlogo4”);
var boxcounter=5;
}
if(boxcounter==5){
logocounter++;
trace(logos[logocounter]);
this.holder5.loadMovie(logos[logocounter]);
var myTween:Tween = new Tween(holder5, “_x”, mx.transitions.easing.None.easeNone,400, endpoint5, 1, true);
trace(endpoint5+“this is endpoint5”);
trace(currentlogo+“this is currentlogo5”);
var boxcounter=6;
}
if(boxcounter==6){
logocounter++;
trace(logos[logocounter]);
this.holder6.loadMovie(logos[logocounter]);
var myTween:Tween = new Tween(holder6, “_x”, mx.transitions.easing.None.easeNone,400, endpoint6, 1, true);
trace(endpoint6+“this is endpoint6”);
trace(currentlogo+“this is currentlogo6”);
var boxcounter=1;
}
}
i’ve been looking around and found this is another post… though it hasn’t worked for me…
[COLOR=#808080]//wait function[/COLOR]
[COLOR=#000000]function[/COLOR] waitCOLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]
[COLOR=#0000ff]stop[/COLOR]COLOR=#000000[/COLOR];
startTime = [COLOR=#0000ff]getTimer[/COLOR]COLOR=#000000[/COLOR];
[COLOR=#0000ff]this[/COLOR].[COLOR=#0000ff]onEnterFrame[/COLOR] = [COLOR=#000000]function[/COLOR]COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]
[COLOR=#0000ff]if[/COLOR] COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]
[COLOR=#0000ff]delete[/COLOR] [COLOR=#0000ff]this[/COLOR].[COLOR=#0000ff]onEnterFrame[/COLOR];
[COLOR=#0000ff]play[/COLOR]COLOR=#000000[/COLOR];
[COLOR=#000000]}[/COLOR]
[COLOR=#000000]}[/COLOR];
[COLOR=#000000]}[/COLOR]
[COLOR=#808080]//pause between frames[/COLOR]
[COLOR=#000000]var[/COLOR] delay = [COLOR=#000080]2000[/COLOR];
and put
waitCOLOR=#000000[/COLOR];
where you want the delay…
so i did that and put
waitCOLOR=#000000[/COLOR];
after the
var boxcounter=2;
in each of the If statements… but no luck…
can anyone shed any light? or suggest a way it get it to hold for a few seconds before running though the loop again? or am i going about this in completely the wrong way??!
thanks very much for your time, i really appreciate the help
cheers
Leapin