[Flash8]Help needed! in pausing script. Look at this thread please!

Hi again forum folk,

Please can someone coment on this post. Every othere post seems to have loads of people viewing them and replying and no one is even looking at my posts. Why?

Anyway I have this script below that is attached to a button called Espanol_but that when the button is clicked(released) moves itself and several other buttons and movie clips around the stage using the tweenClass.


on (release) {
import mx.transitions.*;
import mx.transitions.easing.*;

// Espanol_nut jumps to the ground
    twnBezX = new BezierTween(EspanolNut, "_x", 119.5,  0, 7, false, 120, 70);
    twnBezY = new BezierTween(EspanolNut, "_y", 135.2, 460, 7, false, -50, 200);
    twnBezX._tl = this;
    twnBezX.onMotionFinished = function(){
    this._tl.tweenDone();
}

***PAUSE*** 

//Language buttons bounce off stage to the left
    var xPosT:Tween = new Tween(Espanol_but, "_x", Elastic.easeInOut, 117.1, -500, 2.7, true);
    var xScaleT:Tween = new Tween(Espanol_but, "_rotation", Elastic.easeInOut, 0, 360, 4, true);

    var xPosT:Tween = new Tween(Francais_but, "_x", Elastic.easeInOut, 322.1, -500, 1.7, true);
    var xScaleT:Tween = new Tween(Francais_but, "_rotation", Elastic.easeInOut, 0, 360, 2.5, true);

    var xPosT:Tween = new Tween(Deutsch_but, "_x", Elastic.easeInOut, 527.5, -500, 3.2, true);
    var xScaleT:Tween = new Tween(Deutsch_but, "_rotation", Elastic.easeInOut, 0, 360, 4.5, true);

***PAUSE*** 

//Francais & Deutsch nuts bounce off stage to the left
    var xPosT:Tween = new Tween(FrancaisNut, "_x", Elastic.easeInOut, 324.4, -500, 1.7, true);
    var xScaleT:Tween = new Tween(FrancaisNut, "_rotation", Elastic.easeInOut, 0, 360, 2.5, true);
    
    var xPosT:Tween = new Tween(DeutschNut, "_x", Elastic.easeInOut, 529.9, -500, 2.7, true);
    var xScaleT:Tween = new Tween(DeutschNut, "_rotation", Elastic.easeInOut, 0, 360, 4, true);

***PAUSE*** 

//Year buttons bounce on from right of stage   
    var xScaleT:Tween = new Tween(Year4, "_rotation", Elastic.easeInOut, 90, 0, 3.5, true);
    var xPosT:Tween = new Tween(Year4, "_x", Elastic.easeInOut, 1200, 416.9, 3.5, true);

    var xScaleT:Tween = new Tween(Year3, "_rotation", Elastic.easeInOut, 90, 0, 2.5, true);
    var xPosT:Tween = new Tween(Year3, "_x", Elastic.easeInOut, 1200, 167.4, 2.5, true);

    var xScaleT:Tween = new Tween(Year6, "_rotation", Elastic.easeInOut, 90, 0, 3.9, true);
    var xPosT:Tween = new Tween(Year6, "_x", Elastic.easeInOut, 1200, 416.9, 4, true);

    var xScaleT:Tween = new Tween(Year5, "_rotation", Elastic.easeInOut, 90, 0, 2.9, true);
    var xPosT:Tween = new Tween(Year5, "_x", Elastic.easeInOut, 1200, 167.4, 3, true);
}

Right…What I want to do is pause the executiuon of the code for about 2 seconds at each point that i’ve marked the code above with the word PAUSE.
That way there is a slight lag between each of the buttons and movie clips animating around the stage.

Please can someone help me wih the code I need to make this happen, as I don’t really understand AS too well and need to get this working.

Thanks so much in advance if you can help me with the code I need.

mrdoodle :eye:

Why dont you make a 2 seconds tween with an “invisible mc”… It isnt the best solution but is efective… xD

You could use setTimeout[FONT=monospace].[/FONT]

[quote=mrdoodle;2330337]Every othere post seems to have loads of people viewing them and replying and no one is even looking at my posts. Why?

[/quote]

Possibly because it’s been cross-posted across so many different forums…

Mmm… That’s the best solution! xD

(I didn’t know that function, for these issues I always used setInterval)

Great… but how? I have tried googling it to find more information, but it all just goes straight over my head. I am not a programmer by any means, and I just don’t understand all this stuff. The original code I had I took from a tutorial and just changed the values. Very simple.

Please excuse my ignorance, but you must understand that not everyone knows how to implement all this code. It would really help me if you could provide me with a working example of this setTimeout thing, relevant to what I am doing, that I could just paste into my existing code.

I look forward to your response.

Thanks :party:

Mike

Try searching this forum on the phrase “setTimeout” and you’ll find loads of practical examples. Try a search on “setInterval” too or, better still, look in the identical thread you posted elsewhere for the step-by-step example that I provided for you.