banner



How To Create A Play Button In Flash

Download Article

Download Article

Buttons allow users to interact with and control your Adobe Flash document. You can attach functions and events to buttons by using actionscript 2.0. The newest version of actionscript is 3.0. The two versions of actionscript are not compatible.

Support for Adobe Flash ends in December 2020. After that time, it will no longer be possible to use Flash.

  1. 1

    Open Actionscript 2.0. There are two versions of Adobe Actionscript: Actionscript 2.0 and Actionscript 3.0. Version 3.0 is the newest version and its code is not compatible with Actionscript 2.0. For this tutorial, make sure you are using an Adobe Flash Actionscript 2.0 document.

  2. 2

    Open or create a new Actionscript 2.0 Document. When you launch Adobe Flash, select "Flash File (Actionscript 2.0)." If you already have the program open, use the shortcut Ctrl+N for Windows or Command+N for Macs. [1]

  3. 3

    Insert a button. In Adobe Flash, buttons are quickly created with the button symbol function. To access this function, you can select Insert > Symbol, use the Windows shortcut Ctrl+F8 , or use the Mac shortcut Command+F8 . In the dialog box, enter a new name into the "Name" field. Use the dropdown menu next to "Type" to select "Button." The button will appear in your library (see right panel).[2]

  1. 1

    Define the up frame. Your button has four distinct states: up frame, over frame, down frame, and hit frame. These states are visible in the timeline. The up frame defines the appearance of your button when it is not in use. To create the up frame appearance, you may use the drawing tool. Instead of drawing your own button, you can import a graphic from the "Common Libraries." Select Window > Common Libraries > Buttons. Choose a button graphic and drag it onto the stage.[3]

  2. 2

    Define the over frame. The over frame defines the appearance of the button when the user hovers over it. Click on the box directly below "Over" in the timeline. Select Insert > Timeline > Keyframe. The button you created should appear on the stage. You can alter the location and/or appearance of the button with the tool bar or the properties panel.[4]

  3. 3

    Define the down frame. The down frame defines the appearance of the button when the user selects, or clicks, it. Select the box directly below "Down" on the timeline. Select Insert > Timeline > Keyframe. The button you created in the up frame should appear on the stage. You can change the location and/or appearance of the button with the tool bar or the properties panel.[5]

  4. 4

    Define the hit frame. The hit frame defines an area on the stage that is responsive to the user's cursor. The hit frame is useful if your button is small or oddly shaped. Select Insert > Timeline > Keyframe. Draw a shape that encompasses all three frames and or a larger area. This shape will not appear in the scene or the final product. Defining the hit frame is optional. If you choose not to define it, the up frame will serve as the default hit frame.[6]

  1. 1

    Open the "Actions" panel. When you assign actions to a button, you want to be editing the scene, not the button itself. Click on the scene you would like to edit. Right-click on the button and select "Actions" from the menu. In the "Action" dialog box that appears, you can assign actions by typing in code or inserting code from the "Actions" or library.[7]

  2. 2

    State the function. In Adobe Flash, functions perform specific, repeatable tasks. When the user interacts with buttons via the cursor, these tasks occur. This function is indicated in the actionscript code by on.[8]

  3. 3

    Determine when the action will occur. Events are timing cues that communicate to the program that something has happened. For buttons, these timing cues are executed by the mouse. The event is placed within the parens. Common mouse-related events include press: task is executed when the button is pressed; release: task is performed when mouse is released; rollOver: task is completed when mouse is rolled over the button.[9]

  4. 4

    Name the function. After the close parenthesis, insert a pair of brackets { }. The function you wish to occur when the event occurs in placed within the brackets. Common functions include: play, stop, gotoAndPlay, gotoAndStop, nextframe, next scene, prevFrame, prevScene, stopAllSounds.[10]

                                                on                      (                      press                      )                      {                      gotoAndStop                      ();                      }                    
  5. 5

    Insert the frame or scene number. For some functions, you will need to list a specific frame or scene to go to. Insert the frame or scene number into the parens next to the named function.[11]

                                                on                      (                      press                      )                      {                      gotoAndStop                      (                      12                      );                      }                    

Add New Question

  • Question

    How do I stop the frame from playing when I play the file? Do I have to use another scene?

    Community Answer

    To stop the frame from playing, you should insert a simple stop(); script on the frame itself. Just open the actionscript panel when you're not clicking any objects. When the script works, it should have an "a" on the frame on the timeline.

Ask a Question

200 characters left

Include your email address to get a message when this question is answered.

Submit


Video

Thanks for submitting a tip for review!

About This Article

Thanks to all authors for creating a page that has been read 62,880 times.

Is this article up to date?

How To Create A Play Button In Flash

Source: https://www.wikihow.com/Make-a-Button-in-Adobe-Flash-Actionscript-2.0

Posted by: montgomerycourer1950.blogspot.com

Related Posts

0 Response to "How To Create A Play Button In Flash"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel