
Using Flash components
209
Setting Flash component parameters
Each component has unique parameters that you can set to change its appearance and behavior. A
parameter is a property or method that appears in the Property inspector. The most commonly
used properties and methods appear as authoring parameters; others must be set using scripting
only. After playback has begun, you can get and set parameters on a sprite instance of a Flash
component in much the same way that you customize Flash content. For more information, see
“Using Lingo or JavaScript syntax to set and test Flash variables” on page 189
.
Handling Flash component events
All Flash components have events that are broadcast when the user interacts with a component or
when something significant happens to the component; for example, when the user presses a key
or clicks the mouse. To handle an event, Flash uses ActionScript code that executes when the
event is triggered. You can respond to these events in Director MX 2004 by writing an event
handler in Lingo or JavaScript. Below, you’ll find an example for changing one component. For
complete information about individual components and their properties and events, see Using
Components in the Flash documentation.
To set the Flash Button component events:
1
In the Stage, Score, or Cast window, select a Button Flash component.
2
Open the Property inspector and select the Flash Component tab.
A list of events appears that may be generated by the component. Set the event to true if you
want to respond to the event in Director.
The following example shows how to add a behavior to an instance of the Flash Button
component that prints a message to the Message Window when the button is clicked.
1
Place a Button on the stage and select it.
2
Click the Components tab in the Property inspector.
3
Set the click event to true.
4
In the Behavior inspector, add a new behavior called myClickHandler that contains the
following code:
on click
put "Received a click event!"
end
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...