Groups | Blog | Home
all groups > flash actionscript > july 2007 >

flash actionscript : Help with a simple pause-code function


sr817
7/8/2007 4:57:07 PM
For a week I've been trying to figure out a simple pause-code function fror AS
3.0. I need something that pauses AS code for set amounts of time. People
have tried to help me on this forum, but I've still not been able to make the
code work.

Here is what I have at the moment for pause-code (not working):

var intID;
intID = setInterval(delay, 3000); //this tells flash to wait 3 seconds
function delay(){
clearInterval(intID);
_root.gotoAndPlay(1); // or do something else...
}

The person who supplied me with this code did not include the first line "var
intID", but as a new flash user, I wasn't sure how else to declare intID.
Could someone with some flash experience walk me through the steps of creating
a pause-code function or add to the one I have already provided. When I use
the above code in my flash document, the pause feature does not work at all.
It essentially skips over the setInterval and clearInterval functions and plays
the root clip in delay(). I need code meant for AS 3.0 and I'm becoming
increasingly desperate for a response.

I hope this is understandable and thank you for taking a look,
Sam
kglad
7/8/2007 5:11:41 PM
that's not as3 code.

sr817
7/8/2007 5:15:49 PM
Hello KGlad,
Thankyou for that information. I had no idea lol. Could you please clarify
and explain a little more about using the timer class to delay execution of
code? Possibly provide an example? I would be very grateful.

Thanks,
Sam
sr817
7/8/2007 5:33:58 PM
kglad
7/8/2007 5:40:35 PM
AddThis Social Bookmark Button