PDA

View Full Version : Timed Action



visual
04-04-2007, 01:15 PM
How can I write an ActionScript that is timed? Instead of simply using a ton of frames (calculating at what ever frame rate I use) to cause the action to wait until I want, I would rather use an ActionScript. It would seem to be a cleaner solution. PLUS, I'll learn something new. But I have not been able to figure out how to do it.

I want an action to happen on the screen, for 2 seconds, then another action, then another. Sure, I could simply leave 24 (or 25) frames between each action and let it play through. But there has to be a cleaner way.

I look forward to learning something.

Johnny Gulag
04-04-2007, 03:13 PM
Hello

This goes on the frame where you want it to pause:
this.pause = setInterval(this, "play", 2000);
stop();This goes on the following frame:
clearInterval(this.pause);Hope it helps. :)

visual
04-04-2007, 03:24 PM
Thanks!
Now "Gulag" has a good association in my mind!

Johnny Gulag
04-04-2007, 07:44 PM
Thanks!
Now "Gulag" has a good association in my mind!Did I have a bad association prior to this? :confused:

Edit:
Oh I get it, you meant the word Gulag itself. Sorry for my slowness. :blush:

visual
04-05-2007, 01:44 AM
Yes! My only association to this point was the book American in the Gulag, about an American who ends up in the Soviet Labor Camp. Very exciting book, but the assication to the word "Gulag" is not so flattering.

You have redeemed the word!