0

I don't work in Flash very often, all I need is to add the AS to make my swf pause for a few seconds before looping.

This used to work in AS2:

 stop();
 var interval:Number = setInterval(
   function():Void {
     play();
     clearInterval(interval);
   },
   2000
 );

Any help is appreciated, thanks!

1
  • Probably the simplest way is to duplicate the final keyframe and then add enough regular frames in between to give your pause. It shouldn't increase the size of your movie, since it's using the same library assets. OTOH, you may find that your old script works if you put the stop() after the set interval code. I'm not much on frame scripts, but if I were that would be thre first thing I'd try. Commented Oct 13, 2011 at 19:57

2 Answers 2

2

Make sure you import the utility.

import flash.utils.setInterval;

But rather than using setInterval use setTimeout

import flash.utils.setTimeout;
stop();
setTimeout(
  function():Void {
    play();
  },
  2000
);

To do this the more AS3-esque way, use the Timer class.

Sign up to request clarification or add additional context in comments.

Comments

1

It seems like your current code should still work, except you need to lowercase your "void"

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.