Make a Play Button for an Animation in Adobe Flash Cs4

You made an animation, but when you see that, it just starts playing. But you want to make this stop first and when a button will be pressed, it will start playing. Then go on reading to do this.

Steps

  1. Draw a button by drawing a rectangle or you can use one from Windows->Common Libraries->Buttons. If you'll choose button from common libraries, then skip following steps until you reach at Step-7.
  2. Use Text tool to write "Play" or anything you want above the rectangle. The text must be static text.
  3. Select both text box and rectangle and convert it to symbol by Right click->Convert to symbol.
  4. Name it Playbutton or something you want, select middle point as registration point and select Button. (not movieclip, not graphic, button)
  5. Double click your newly made button in the stage. This will take you to a new page where there will be another set of empty frames and a bar at the top which also says scene 1 and the name of your button.
  6. On the second frame (over), make a new keyframe and draw what it will look like when you roll over it.
  7. Press Scene 1 on the top bar and move your button to place it anywhere on the stage.
  8. Select the current frame (which contains the button) and press F9.
  9. Type or copy and paste below action script in Action panel.
    • stop();
    • Due to this statement animation will stop at that frame.
  10. Click the button from the stage and press F9. This takes you to the Action panel.
  11. Copy and paste this script.
    • on(release){ nextFrame(); }
    • on(release) means on release of your mouse click from the button the next statement or block will invoke. { starts a block . nextFrame(); means go to the next frame. Instead of nextFrame(), you can put gotoAndStop(frame you want to go) and the } means end of block or function.
  12. Go to Control->Test movie to test your work. Select File->Publish to publish your work.



Tips

  • To publish in different file format, go to File->Publish setting.

Warnings

  • This only works for actionscript 2 not for actionscript 3.