This is just some code for myself for future reference, when you need a flash file to loop 3 times and stop toss this in your actions layer on the final key frame.
if (!loop) {
var loop:Number = 0;
}
loop++;
if (loop >= 3) {
this.stop();
}
Tips and Tricks
Action Script, AS3, Looping
So I logged on to check out some of my favorite blogs and the Cartoon Smart had a small but excellent post Actionscripters check out this search engine just for you!
Which Directed me to Actionscript only search engine at Hexosearch.com So no more having to sort through tons of google pages to get the information your looking for, that often gets cluttered with junk. On Hexo if you search ” Create Random ” pause it actually brings up my blog which gives you the actionscript code for you to be able to copy and paste and put into action.
When i’m working in Flash this site will be my new best friend, except for of course my plether of cartoonsmart files that I have purchased over the last few years. They will always be the first place I turn to when I get stuck.
Tips and Tricks
Actionscript, AS2, AS3
When your looking to create a delay say on multiple movie clips so that the animations, play at different times, but you need to have a stop state here’s some code that will make it easier.
This allows you to setup a time delay before playing the next frames so you can have different start times.
stop();
var timer:Timer = new Timer(Math.random() * (10000 – 2000) + 1000, 1);
timer.start();
timer.addEventListener(TimerEvent.TIMER_COMPLETE, hope);
function hope(event:TimerEvent):void{
play();
}
Tips and Tricks
AS3, Flash