MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference page 73

Actionscript 2.0 language reference
Table of Contents

Advertisement

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:Number = setInterval(checkParamsLoaded, 100);
The external file,
params.txt
var1="hello"&var2="goodbye"&done="done"
See also
loadVariablesNum function
,
function
loadMovie (MovieClip.loadMovie method)
(MovieClip.loadVariables method)
or
. If there are no variables to be sent, omit this parameter. The
POST
.
done
, includes the following text:
,
loadMovie function
,
load (LoadVars.load method)
must be in the same domain as the SWF file;
url
createEmptyMovieClip()
,
loadMovieNum function
,
loadVariables
. The
setInterval()
,
getURL
Global Functions
73

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash 8

Table of Contents

Save PDF