AS2 Frame coding
Started by: bl3u | Replies: 2 | Views: 465
Mar 4, 2014 5:35 AM #1169426
Any way to make it so when a .swf loads. It loads on a random frame in the animation?
Mar 4, 2014 11:11 AM #1169649
I don't think so, because it would have to be on a frame before it could look at any code. The best you could do would probably be to put randomising code on the first frame and set the frame rate so high that no one sees it flicker. Don't know whether that'll be good enough; depends what you need it for.
Mar 4, 2014 9:06 PM #1170357
it will always load on the first frame before it does anything. you could leave the first frame blank (except for code) and make it go to a random frame almost instantaneously, though. unlikely that anybody would notice.
something like
var randomFrame:int = Math.round(Math.random(_root._totalframes));
onClipEvent(enterFrame){
gotoAndStop(randomFrame);
}
might do the trick (that's pseudocode, you'll need to fix it up yourself. i'm not sure if that's how _totalframes works.)
something like
var randomFrame:int = Math.round(Math.random(_root._totalframes));
onClipEvent(enterFrame){
gotoAndStop(randomFrame);
}
might do the trick (that's pseudocode, you'll need to fix it up yourself. i'm not sure if that's how _totalframes works.)