User Guide
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.