
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
28
|
Chapter 1: A Gentle Introduction for Nonprogrammers
Observe, again, the use of the comment before the stop( ) function call. That com-
ment explains the intended effect of the code that follows.
Comments are optional, but they help clarify our code in case we leave
it for a while and need a refresher when we return, or if we pass our
code onto another developer. Comments also make code easy to scan,
which is important during debugging.
Now that you know what our init code does, let’s attach it to frame 1 of our quiz
movie’s scripts layer:
1. Select frame 1 of the scripts layer.
2. Use Window
➝ Actions (F9) to open the Actions panel.
3. Make sure you’re using Expert Mode, which can be set as a permanent prefer-
ence via the pop-up Options menu in the top right corner of the Actions Panel.
4. In the right side of the Actions panel, type the init code as shown earlier in
Example 1-1.
Adding Frame Labels
We’ve completed our quiz’s init script and built our questions. We will now add
some frame labels to help control the playback of our quiz.
In order to step the user through our quiz one question at a time, we’ve separated the
content for Question 1 and Question 2 into frames 1 and 10. By moving the play-
head to those keyframes, we’ll create a slide show effect, where each slide contains ...