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
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:
In the Stage, Score, or Cast window, select a Button Flash component.
1
Open the Property inspector and select the Flash Component tab.
2
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.
Place a Button on the stage and select it.
1
Click the Components tab in the Property inspector.
2
Set the click event to true.
3
In the Behavior inspector, add a new behavior called myClickHandler that contains the
4
following code:
on click
put "Received a click event!"
end
189.
Using Flash components
209
Need help?
Do you have a question about the DIRECTOR MX 2004-USING DIRECTOR and is the answer not in the manual?