MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference page 61

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

If you want to load variables into a specific level, use
.
loadVariables()
Availability: ActionScript 1.0; Flash Lite 1.1 - Behavior changed in Flash Player 7.
Parameters
- An absolute or relative URL where the variables are located. If the SWF file
url:String
issuing this call is running in a web browser,
for details, see the Description section.
- The target path to a movie clip that receives the loaded variables.
target:Object
[optional] - Specifies an HTTP method for sending variables. The parameter
method:String
must be the string
GET
method appends the variables to the end of the URL and is used for small numbers of
GET
variables. The
method sends the variables in a separate HTTP header and is used for
POST
long strings of variables.
Example
The following example loads information from a text file called params.txt into the
movie clip that is created using
target_mc
function is used to check the loading progress. The script checks for a variable in the
params.txt file named
this.createEmptyMovieClip("target_mc", this.getNextHighestDepth());
loadVariables("params.txt", target_mc);
function checkParamsLoaded() {
if (target_mc.done == undefined) {
trace("not yet.");
} else {
trace("finished loading. killing interval.");
trace("-------------");
for (i in target_mc) {
trace(i+": "+target_mc[i]);
}
trace("-------------");
clearInterval(param_interval);
}
}
var param_interval = setInterval(checkParamsLoaded, 100);
The external file,
params.txt
var1="hello"&var2="goodbye"&done="done"
or
. If there are no variables to be sent, omit this parameter. The
POST
.
done
, includes the following text:
loadVariablesNum()
must be in the same domain as the SWF file;
url
createEmptyMovieClip()
instead of
. The
setInterval()
Global Functions
61

Advertisement

Table of Contents
loading

Table of Contents