Randomly pick a frame on stage


/ Published in: ActionScript 3
Save to your folder(s)



Copy this code and paste it in your HTML
  1. button_btn.addEventListener(MouseEvent.CLICK, myClickReaction);
  2.  
  3. function myClickReaction (e:MouseEvent):void
  4.  
  5. {
  6. gotoAndStop( Math.ceil(Math.random() * 4) );
  7. trace (currentFrame);
  8. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.