Does anyone know how you can pause an actionscript code? I’ve found posts which explain how to pause animations, but none on how to pause actual actionscript commands :-\
A quick example would be to make a box increase in size (which was done through AS). But when it gets to 100 pixels wide, i want it to pause for 3 seconds before continuing again. Thanks for the help!
You can use the break; command to exit a method. And then at the same time you exit the code you can call an interval that has been made to call another function after 3 seconds, then clear that interval.
Doesn’t setInterval keep repeating? anyways this is the code i have:
[AS]
function lengthIn(mc1, finWidth, finHeight) {
mc1.onEnterFrame = function() {
mc1._width += 30;
if (mc1._width>=finWidth) {
mc1._width = finWidth;
//Trying to get the 3 seconds to start here, and then do the stuff under
mc1._height += 30;
if (mc1._height>=finHeight) {
mc1._height = finHeight;
delete mc1.onEnterFrame;
}
}
};
}
[/AS]
This is what i’m tryin to do (if you look at the comment in the code that is what i want…but i’m not sure how i can do it :-\ thanks!