Lesson 1

Work with the Actions Panel

 

OBJECTIVE:

In this lesson, you will use ActionScript and frame labels to create navigation to specific frames on the Timeline

Sample Solution

Lesson:  Create a frame label

  1. Open fl9_.fla from the Digital Design folder on the server
  2. Save it as 'sale' to your Flash C9 folder
  3. Drag the playhead through the Timeline to see the parts of the movie—there are four different screens:  in frames 1, 5, 10, and 15—there are also four stop actions in the corresponding frames on the action layer, which stop the movie after each screen is displayed
  4. Insert a new layer above the buttons layer, then name it 'labels'
  5. Insert a keyframe in frame 10 on the labels layer
  6. Open the Properties panel, click frame 10 on the labels layer, click the Name text box in the LABEL area on the Properties panel, type 'try_out' for the frame label, press Enter
  7. Insert a keyframe in frame 15 on the labels layer, click the Name text box in the Properties panel, name the frame 'one_on_one', then press Enter—a flag symbol in frame 15 on the labels layer indicates a frame label has been inserted

Summary:  You added a new layer and used the Properties panel to create frame labels.

 

Lesson:  Use frame labels with actions

  1. Set the view to Fit in Window, then click the Try Out button on the Stage to select it
  2. Open the Actions panel, then verify that Script Assist is turned on
  3. Verify the button symbol and upper_1 is displayed at the bottom left of the Script pane—the button is named upper_1
  4. Click the 'Add a new item to the script' button, point to Global Functions, point to Movie Clip Control, then click 'on'
  5. Click the 'Add a new item to the script' button, point to Global Functions, point to Timeline Control, then click 'goto'
  6. Click the Type list arrow, then click 'Frame Label'
  7. Click the Frame list arrow, click 'try_out'
  8. Click Control (on the menu bar), click 'Test Movie' to test the movie, then click the 'Try Out' button—the movie jumps to the shoes product frame
  9. Close the Flash Player window

Summary:  You created navigation by referencing an action to a frame label.

 

Lesson:  Work in the Actions panel without Script Assist

  1. Click the Script Assist button to turn it off
  2. Click the View Options button (on the Actions panel)
  3. Verify that Line Numbers has a check mark next to it, then click the Stage to close the Options menu
    [Note:  the Action Script code disappears from the Script pane because the object is no longer selected]
  4. Click the Consultant button on the Stage, then verify the upper_2 button symbol is displayed in the lower left of the Script pane
  5. Click next to 1 in the Script pane, then type '// navigation for button'—this comment will be ignored when the ActionScript runs—comments that explain the intent of your ActionScript can help when troubleshooting, and they are especially important if you are working collaboratively on a movie
  6. Press Enter to insert a new line, then type 'on('  -  the code hint list appears, displaying the options for the action
    [TIP:  You can also click the Show code hint button to display the code hint list]
  7. Double-click release to select it, type ')' to end the function, press  Spacebar, then type '{'
  8. Press Enter to move to line 3, then then type 'gotoAndStop('  -  a code hint appears, displaying the syntax for the action
    [TIP:  Be sure to use exact case when typing actions]
  9. Immediately after the opening parenthesis, type '“one_on_one”);'  -  the quotation marks indicate that one_on_one is a frame label—this code instructs the program to stop at the frame labeled one_on_one when the Consultant button is clicked—the semicolon indicates the end of a line of code
  10. Press Enter to move to Line 4, then type ']'
  11. Click the Auto format button at the top of the Script pane, then click the 'Check syntax button'—If an error message appears, check your screen with the above instructions and make changes as necessary
  12. Click OK to continue
  13. Test the movie, then click the Consultant button—the movie jumps to the consultation frame
    [Note:  If the Consultant button does not work, check your code carefully—it needs to be precise—make sure that the curly brackets are used as specified]
  14. Close the Flash Player window, close the Actions panel, save your work, then close the file

Summary:  You created navigation by writing code using a frame label in the Actions panel, and you checked the format and syntax of the script.