
Writing behaviors with Lingo or JavaScript syntax
281
Go to Marker
moves the playhead to the specified marker.
Go to Net Page
goes to the specified URL.
Wait on Current Frame
waits at the current frame until another behavior or script advances to
the next frame.
Wait until Click
waits at the current frame until the mouse button is clicked.
Wait until Key Press
waits at the current frame until a key is pressed.
Wait for Time Duration
waits at the current frame for the specified time.
Play Cast Member
plays the specified sound cast member.
Play External File
plays the specified external sound file.
Beep
plays the current system beep.
Set Volume
sets the system volume level to the specified setting.
Change Tempo
changes the movie’s tempo to the specified setting.
Perform Transition
performs the specified transition.
Change Palette
changes to the specified palette.
Change Location
moves the current sprite to the specified coordinates.
Change Cast Member
switches the sprite’s cast member to the specified cast member.
Change Ink
switches to the specified ink.
Change Cursor
changes the pointer to a shape you select from the pop-up menu.
Restore Cursor
restores the current system pointer.
New Action
executes any method or sends a message to a handler. You specify the new
handler’s name.
Writing behaviors with Lingo or JavaScript syntax
If you are familiar with Lingo or JavaScript syntax, you can author your own behaviors.
A behavior is a Lingo or JavaScript syntax script with these additional features:
•
Each instance of the behavior has independent values for properties. The script uses a
property
statement to declare properties that can have independent values in each instance
of the behavior. For more information, see the Scripting Reference topics in the Director
Help Panel.
•
The same set of handlers can be shared by multiple sprites or frames.
The handlers in a behavior are basically the same as other handlers. Include as many handlers
as appropriate to implement the behavior.
A behavior is usually attached to multiple sprites or frames. As a result, the sprites and frames
share the same handlers. Director tracks which instance of the behavior is which by assigning
each instance a reference number. The variable
me
contains the reference for the object that the
instance of the behavior is attached to.
In many cases, it is most efficient to create behaviors dedicated to specific tasks and then attach
a set of behaviors that perform together the variety of actions you want.
Summary of Contents for DIRECTOR MX 2004-USING DIRECTOR
Page 1: ...DIRECTOR MX 2004 Using Director...
Page 16: ...16 Chapter 1 Introduction...
Page 82: ...82 Chapter 3 Sprites...
Page 98: ...98 Chapter 4 Animation...
Page 134: ...134 Chapter 5 Bitmaps...
Page 242: ...242 Chapter 10 Sound and Synchronization...
Page 274: ...274 Chapter 11 Using Digital Video...
Page 290: ...290 Chapter 12 Behaviors...
Page 302: ...302 Chapter 13 Navigation and User Interaction...
Page 334: ...334 Chapter 15 The 3D Cast Member 3D Text and 3D Behaviors...
Page 392: ...392 Chapter 16 Working with Models and Model Resources...
Page 418: ...418 Chapter 18 Movies in a Window...
Page 446: ...446 Chapter 22 Managing and Testing Director Projects...