-
<< Random gotoandPlay >> ©
Hi!
how can a make a random gotoandPlay? [random between frames]
thank u
-
Use the Math.random and Math.floor methods (explained in online help & the AS dictionary). The code below, on a button, sends the playhead to a random frame between 1 and 30:
on(release){
randomFrame = Math.floor(Math.random() * 30 + 1);
gotoAndPlay(randomFrame);
}
-
Originally posted by Mollose
Use the Math.random and Math.floor methods (explained in online help & the AS dictionary). The code below, on a button, sends the playhead to a random frame between 1 and 30:
on(release){
randomFrame = Math.floor(Math.random() * 30 + 1);
gotoAndPlay(randomFrame);
}
thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|