
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Loading External Variables
|
59
create a new variable in the movie clip listed in the Scope chain column of the table.
We’ll examine this topic more closely in Chapter 10.
Loading External Variables
While most variables are created directly inside Flash, it’s also common to load vari-
ables from an external text file, server script, or web page. Loading external variables
does not mean simply assigning a value from an external source to existing variables.
Loading external variables actually creates new variables at runtime. The following
entries in the Language Reference explain various variable-loading techniques:
• LoadVars
• loadVariables( )
• fscommand( )
Additionally, in some browsers, JavaScript can set a variable in Flash at runtime
using the syntax:
movieObj.SetVariable("/someClip:firstName", "Colin");
where movieObj is an object reference to the Flash movie embedded in the page. This
technique works only in the following browsers:
• Internet Explorer on Windows
• Netscape 4 on Windows, Macintosh, and Linux
• Netscape 6.2 with Flash Player 6.0.40.0 (or higher) on Windows, Macintosh,
and Linux
For complete details, see:
http://www.moock.org/webdesign/flash/fscommand/
Table 2-2. Event handler scope
Event handler type Scope chain
Callback function Global object
Clip in which the function was ...