Adobe 65036570 Tutorial - Page 29

Test your script, Add markers to two additional scenes, GoAnim

Page 29 highlights

ADOBE DIRECTOR 11.0 29 Create a basic movie You start by adding scripts to the button sprites in the start scene. 1 In the Score, display frames 1 through 10. 2 Right-click (Windows) or Control-click (Macintosh) the Animation button sprite in channel 3, frames 1 through 10. 3 In the context menu, select Script. The Script window opens with a default handler entered: on mouseUp me end 4 On the second line, type the following script: _movie.go("Animation") You see the following result: on mouseUp me _movie.go("Animation") end 5 In the Name text box at the top of the Script window, type GoAnim. 6 Close the Script window, and save your movie. This handler has three parts. The first line tells Director to trigger this handler when the user clicks on the button sprite to which the script is attached. Specifically, the mouseUp event refers to the action of releasing the mouse button after it has been pressed. This way the script does not run until the user releases the mouse button when clicking. The second line of the handler contains the same code as the previous script that you wrote. It sends the playhead to the frame that contains the marker named Animation. The difference between these two scripts is that this one performs its action based on a mouse click, not on an exitFrame event. Again, the word end on the last line tells Director that the script is finished. Test your script You are now ready to try out your new button script. 1 If necessary, bring the Stage window to the foreground by clicking its title bar. 2 Rewind and play your movie. The movie plays, and the start scene remains on the screen. The playhead does not move to another scene until you click your newly scripted button. 3 Click the Go to Animation button on the Stage. The button provides feedback by changing color when it is clicked. The playhead moves to the first frame of the animation scene, and the tire bounces. 4 Stop your movie. Add markers to two additional scenes Your first button is complete. To use similar scripts on the remaining navigation buttons, you can add markers to the start scene as well as the sound and video scene.

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37

ADOBE DIRECTOR 11.0
Create a basic movie
29
You start by adding scripts to the button sprites in the start scene.
1
In the Score, display frames 1 through 10.
2
Right-click (Windows) or Control-click (Macintosh) the Animation button sprite in channel 3, frames 1 through
10.
3
In the context menu, select Script.
The Script window opens with a default handler entered:
on mouseUp me
end
4
On the second line, type the following script:
_movie.go("Animation")
You see the following result:
on mouseUp me
_movie.go("Animation")
end
5
In the Name text box at the top of the Script window, type
GoAnim
.
6
Close the Script window, and save your movie.
This handler has three parts. The first line tells Director to trigger this handler when the user clicks on the button
sprite to which the script is attached. Specifically, the
mouseUp
event refers to the action of releasing the mouse
button after it has been pressed. This way the script does not run until the user releases the mouse button when
clicking.
The second line of the handler contains the same code as the previous script that you wrote. It sends the playhead
to the frame that contains the marker named Animation. The difference between these two scripts is that this
one performs its action based on a mouse click, not on an
exitFrame
event.
Again, the word
end
on the last line tells Director that the script is finished.
Test your script
You are now ready to try out your new button script.
1
If necessary, bring the Stage window to the foreground by clicking its title bar.
2
Rewind and play your movie.
The movie plays, and the start scene remains on the screen. The playhead does not move to another scene until
you click your newly scripted button.
3
Click the Go to Animation button on the Stage.
The button provides feedback by changing color when it is clicked. The playhead moves to the first frame of the
animation scene, and the tire bounces.
4
Stop your movie.
Add markers to two additional scenes
Your first button is complete. To use similar scripts on the remaining navigation buttons, you can add markers to the
start scene as well as the sound and video scene.