Writing Behaviors With Lingo Or Javascript Syntax; Setting Up A Parameters Dialog Box - Adobe 65036570 - Director - PC User Manual

User guide
Hide thumbs Also See for 65036570 - Director - PC:
Table of Contents

Advertisement

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
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 instances of the behavior by assigning a reference number to each instance. The
variable
contains the reference for the object that the instance of the behavior is attached to.
me
In many cases, it is most efficient to create behaviors dedicated to specific tasks and then attach a set of behaviors
that together perform the variety of actions you want.
The behavior can have parameters that users edit from the Parameters dialog box. The optional
getPropertyDescriptionList
Reference topics in the Director Help Panel.
A description of the behavior can be added to the Behavior inspector. The optional
getBehaviorDescription
mation, see the Scripting Reference topics in the Director Help Panel.
A brief description appears as a tooltip for the behavior in the Library palette if the optional
handler that creates the tooltip has been written. For more information, see the Scripting
getBehaviorToolTip
Reference topics in the Director Help Panel.

Setting up a Parameters dialog box

You can make behaviors more flexible by letting the user customize the behavior's parameters.
For example, this handler moves the sprite 5 pixels to the right each time the playhead enters a new frame:
if ( sprite(me.spriteNum).locH > window("stage").rect.right ) then
sprite(me.spriteNum).locH = window("stage").rect.left
else
sprite(me.spriteNum).locH = sprite(me.spriteNum).locH + 5
end if
However, users could adjust the speed of each sprite if they could specify how far individual sprites move to the right
in each frame.
handler sets up the Parameters dialog box. For more information, see the Scripting
handler displays a description of the behavior in the Behavior inspector. For more infor-
ADOBE DIRECTOR 11.0
User Guide
statement to
property
on
on
on
281

Advertisement

Table of Contents
loading

This manual is also suitable for:

Director 11

Table of Contents