↑
Main Page
Flash-to-JavaScript communication
Flash Constant
Value
Description
Y_SCALE
3
Vertical scaling
CURRENT_FRAME
4
The position of the current frame in the movie
TOTAL_FRAMES
5
The total number of frames in the movie
ALPHA
6
The opacity of the movie (number between 0 and 100)
VISIBLE
7
If the movie is visible or not
WIDTH
8
The width of the movie
HEIGHT
9
The height of the movie
ROTATION
10
The rotation of the movie in degrees
TARGET
11
The timeline name (same as first argument of any of the
timeline-specific methods)
FRAMES_LOADED
12
The number of frames currently loaded
NAME
13
The name of the movie
DROP_TARGET
14
The name of the drop target inside the movie, if one exists
URL
15
The URL of the movie
HIGH_QUALITY
16
If the movie is in high-quality rendering mode or not
(1 for true, 0 for false)
FOCUS_RECT
17
Whether or not a focus rectangle should be displayed
(1 for true, 0 for false)
SOUND_BUF_TIME
18
The amount of time that sound should be buffered to
produce uninterrupted playback
When using the timeline-specific methods, the first argument is always the name of the timeline to act
on. The default timeline is represented by a single forward slash:
var iXPos = oFlashMovie.TGetProperty(“/”, 0);
The first argument is always mirrored by the
TARGET
property:
var sTarget = oFlashMovie.TGetProperty(“/”, 11);
alert(sTarget == “/”); //outputs true
Because Flash uses an ECMAScript-based scripting language called ActionScript, the interaction with
JavaScript is seamless.
Flash-to-JavaScript communication
Flash also has the capability to interact with JavaScript that exists on the HTML page in which it is
embedded. When using the
<object/>
element to embed the Flash movie, this capability is enabled by
555
Interacting with Plugins
21_579088 ch18.qxd 3/28/05 11:43 AM Page 555
Free JavaScript Editor
Ajax Editor
©
→