Monday, March 29, 2010

Need to make a Replay button

Ok, so the company I work for doesn't want any more looping banner ads anymore.聽 Now they want me to stop the animation at 15 seconds and create a Replay button so the user can click on it to start the animation again.聽 I know how to make the button but I don't know the Actionscript to make it go to frame one and start again and I'm also not sure how to incorporate this with the Stop action.聽 Kinda new at this so any help is greatly appreciated, thanks in advance!

Need to make a Replay button

if you're using timeline animation, attach a stop() to the last frame of the timeline that you do not want to repeat (without a button click) and attach a simple button to this frame.聽 give the button an instance name (say, btn) and, if you're using as2, use:

btn.onRelease=function(){

this.gotoAndPlay(1);

}

Need to make a Replay button

right i found this code useful when i was making flash games

on(reslease){

聽聽聽 gotoandplay(type in the frame number here);

}

from wadahell


What if I want the button to fade up instead of instantly appearing on the last frame?


then create a loop (setInterval() or onEnterFrame) and fade it in.

No comments:

Post a Comment