How to Make a Play Button in Flash 8

How to Make a Play Button in Flash 8 thumbnail
Learning how to add code to a "Play" button is an important step to understanding AS3.

Creating a "Play" button in Flash requires using the ActionScript AS3 programming language. Computer programming has two main aspects: a series of steps for the computer to carry out and manipulation of data. To create a play button in ActionScript AS3, you must first stop the program from playing, then give the user the choice to play.

Instructions

    • 1

      Open Flash and click "File," then "New." From the pullout menu, click "Flash File (ActionScript 3.0)."

    • 2

      Click on the "Rectangle" tool from the tool bar, and while holding down your mouse, drag across the stage to draw a rectangle.

    • 3

      Click on the "Text" tool and type "Play" on top of the rectangle.

    • 4

      Click on both the "Rectangle" and the "Play" text to highlight them, and then from the main menu, click "Modify." Click "Convert to New Symbol" from the pullout menu. Click on the "Button" radial box and type in "playMC" for the name.

    • 5

      Click "Window" from the main menu. Click "Properties" and then "Properties" again from the pullout menu. With your background and text still highlighted, type in "play_btn" for the "Instance Name" in the "Properties" panel.

    • 6

      Right-click on frame "1" of your "Action" layer, then click "Action" from the pullout menu. Type in the following code:

       

      stop;

       

      playBtn.addEventListener(MouseEvent.CLICK, onPlayClick, false, 0, true);

       

      function onPlayClick(evt:MouseEvent):void {

      play();

      }

      To test your movie, click on "Control" from the main menu, then click on "Test Movie."

Related Searches:

References

  • Photo Credit play icon. (with clipping path) image by Andrey Zyk from Fotolia.com

Comments

You May Also Like

Related Ads

Featured