
Using Lingo or JavaScript syntax to set and test Flash variables
189
Controlling Flash content interactivity with Lingo or JavaScript syntax
Lingo or JavaScript syntax can control whether Flash content remains interactive. For more
information, see the Scripting Reference topics in the Director Help Panel.
•
To control whether the actions in Flash content are active, set the
actionsEnabled
property
to
TRUE
.
•
To control whether buttons in Flash content are active, set the
buttonsEnabled
property.
•
To control when Flash content detects mouse clicks or rollovers, set the
clickMode
property.
•
To control whether clicking a button in Flash content sends events to sprite scripts, set the
eventPassMode
property.
•
To determine which part of Flash content is directly over a specific point on the Stage, use the
hitTest
method.
•
To check whether the mouse pointer is over a button in Flash content, test the
mouseOverButton
property.
Using Lingo or JavaScript syntax to set and test Flash variables
In previous Director releases it was necessary to use the
getVariable()
and
setVariable()
methods to access Flash variables. Director MX 2004 now allows you to access Flash variables and
execute methods directly on the Director sprite.
To set a Flash variable:
•
Use the following syntax:
spriteReference.myFlashVariable = "newValue"
For example, the following expression sets the Flash variable called myColorSwatch to red on
the sprite called myFlashSprite:
sprite("myFlashSprite").myColorSwatch = "red"
To get the value of a Flash variable:
•
Use the following syntax:
put spriteReference.myFlashVariable
For example, the following expression gets the value of the Flash variable called
myColorSwatch on the sprite called myFlashSprite:
put sprite("myFlashSprite").myColorSwatch
To execute a Flash method:
•
Use the following syntax:
spriteReference.myFlashMethod()
For example, the following expression calls the method setColorSwatch on the sprite called
myFlashSprite:
sprite("myFlashSprite").setColorSwatch("blue")
For more information, see
“Using Flash objects in script” on page 193
.
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...