CIS 421 Flash > Create Button Symbols

Create Button Symbols

Simple movie with start and stop buttons

Create new button symbol

  • Choose insert>new symbol (or CONTROL + F8)
  • In symbol properties box, name symbol "button1" and select behavior button, then click ok
  • Symbol Editing Screen opens with 4 button Frames
  • UP- button as it will display on the screen when movie opens
  • OVER - button as it will display on rollover
  • DOWN - button as it will display on click
  • HIT - defines hit area (hotspot) of button -- does not display

Change the name of Layer 1 to Button

  • Click in the Up frame of the Button layer
  • Select the Rectangle Tool
  • Change the fill color to blue and the stroke color to nothing(square with line through it)
  • Click rounded corners tool in the Options section of the Toolbar, and type 20 in the dialog box
  • Draw a simple button centered around the crosshairs in the symbol editing window

Change the colors of the Over, Down, and Hit frames

  • Click F6 in the Over Frameto make it a keyframe
  • Select another button fill color for rollover in the paint bucket under colors on the toolbar options
  • Click F6 in the Down frame to make it a keyframe & select a different color in the paint bucket
  • Click F6 in the Hit frame
  • You don't need to change the color of this frame because it is invisible -- it defines the button's hotspot.
  • If you have a very small button or are using text for a button, you should paint a larger hit area in this keyframe so the user doesn't miss it.

Add text "stop" to button

  • Add a new layer to the button and name it text
  • Click in the Up frame of the text layer
  • Click the Text tool on the Toolbar
  • Open the Property inspector to set the text characteristics
  • Choose an appropriate font, font color, and font size
  • Center text
  • position cursor over center of button, and type stop
  • Click the Arrow Tool on the Toolbar and move the text to the center of the button -- you can use the arrow keys on the keyboard to move the text one pixel at a time

Add a filter effect to the text

  • Click the Filters tab in the Text Property Inspector
  • Select one of the filter effects to apply to the text: bevel, dropshadow, etc.
  • Hit F6 to make a keyframe in the Over frame --
  • Text will persist to Over frame
  • if you want a new text color you can click the Text tool, select the text and change the color in the property inspector
  • Hit F6 to make a keyframe in the Down frame and repeat
  • You don't need text in the hit frame

Add sounds to Button states

  • Right click: soundss.fla --save to disk
  • File>Import>Open External Library and select soundss.fla
  • Should open as a library in your Flash movie 2718East8thSt
  • Click on over keyframe in button window.
  • Select one of sounds and drag it into the button symbol editing window -- sound wave appears in button state
  • If desired, c lick on down keyframe and repeat with a different sound.
  • Rollover and down buttons will now make sounds

Create other Buttons by duplicating button1, the Stop button from ibrary

  • Stop button should be there as new symbol called button1
  • Right click name "button1" in library list to select stop button.
  • Click Duplicate to create a copy of stop button.
  • Call the duplicate button "button2"
  • Double click button2 in Library to open it in Editing window
  • The start button should appear on the stage with its 4 states
  • Change the text on the button to "start" by selecting the type tool and changing "op" to "art" in the text layer of each button state
  • Create another duplicate called button3 in same way
  • Change the text on the button states to URL
  • Save the movie
  • The movie library should contain your buttons and any sounds you added from soundss.fla

Use the Buttons to start and stop your movie - be sure button is selected and not Frame!

Note: If you insert each button into its own layer, you will NOT select two of them when you create the actionscript.

If you accidentally select two buttons (or they become attached to one another), your actionscript does not work.

If you give your button symbols instance names in their property inspectors, it is easier to identify which button you are working on.

In fact, you could reuse the same button symbol over and over, but you would need to type different text on the button instance when you insert it on the stage.

Create a layer for first button

  • Click Scene 1 on the timeline to exit Symbol Editing & return to movie editing
  • Turn on the grid so you can line up the buttons next to each other (View>Grid>Show Grid)
  • Click View>Grid>Snap to Grid to line up the buttons

Insert the second button into its own layer in movie timeline

  • Click the + button on the Timeline to insert a new layer and name it start BTN.
  • Click the cursor in the last Keyframe and click F6 to make it a keyframe so button persists to end of movie
  • Click the cursor in Keyframe 1
  • In Library window, select the button2, which is the start button
  • Drag the image of the button onto the stage and place it on left bottom corner -- line up on grid line
  • Type start_BTN into instance name box in property inspector
  • Create a new layer for the symbol button1 (stop BTN) and repeat
  • Create a third layer for the URL button and repeat
  • Name instance of button "url_Btn" in property inspector

Filter Effects

  • apply to text, buttons and movieclips only
  • you can select each button
  • select filters tab in property inspector for button
  • click the plus sign to see a popup menu of the available effects
  • select an effect and apply to each button

Movieclip as button state

  • Create a movieclip, rotate, that just rotates in one place and does not move out and back (when you do the tweening, select motion tween, rotate clockwise 5 times over 10 frames
  • Create a new button called movieclip button
  • Draw a round shape in the up state that is the same size as the movieclip
  • Create a keyframe in the over state and down state and change the color of the button each time
  • Create the hotspot keyframe
  • Turn on onion skinning
  • Add a new layer for the rotate movieclip
  • Drag this layer below the button layer, so the rotating star is behind the button
  • Create a keyframe in the rollover state of the button, and and drag the movie clip onto it
  • Create keyframes for the other button states, but delete the movieclip from them so it only exists in the rollover state.
  • Click Scene 1 in the Timeline to Edit the movie.
  • Create a new layer for the movie called Button
  • Drag the button onto the button layer in Keyframe 1 of the Button layer.
  • Click F6 in Frame 20 of the Button layer to make the ending keyframe
  • Click Control>Test Movie
  • When the user rolls over the button the movieclip symbol will rotate.

Resources: