How to Add a Replay Button in Flash


Adobe Flash enables you to create an animation via a timeline. The timeline manages your animation from the first frame to the last. You would likely insert a stop command in the last frame to cause the presentation to end, instead of looping over and over. Add a replay button to your presentation to give the user control over viewing your animation again.

  • Open your Flash application. Click "File," "Open." Select the file you want to add the replay button to and click "Open."

  • Select the Text tool from the Tools panel. Type "Replay" on the stage. Choose the Arrow tool and press "F8." Type an identifier for your button in the Name field, and choose the "Button" option.

  • Type "replayBtn" in the Instance Name field, found in the Properties panel. Press "F9" to open the Actions panel and insert the following code to create the actions for the button:

    replayBtn.onRelease = function(){



  • The value in the "gotoAndPlay" function as entered here represents the first frame. When the button is clicked and released, the animation starts over at the first frame. Change this value to meet your needs.

Related Searches

  • Photo Credit Jupiterimages/ Images
Promoted By Zergnet



You May Also Like

Related Searches

Check It Out

Geek Vs Geek: Robot battles, hoverboard drag race, and more

Is DIY in your DNA? Become part of our maker community.
Submit Your Work!