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!
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.
It seems like your current code should still work, except you need to lowercase your "void"
精彩评论