MACROMEDIA FLASH MX 2004-ACTIONSCRIPT LANGUAGE Reference page 377

Actionscript language reference
Table of Contents

Advertisement

If you want to load variables into a specific level, use
.
loadVariables()
Example
The following example loads information from a text file called params.txt into the
movie clip that is created using
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);
// params.txt includes the following text
var1="hello"&var2="goodbye"&done="done"
See also
loadVariablesNum(), loadMovie(), loadMovieNum(), getURL(),
MovieClip.loadMovie(), MovieClip.loadVariables(),
createEmptyMovieClip()
loadVariablesNum()
. The
setInterval()
LoadVars.load()
instead of
target_mc
function is used
.
done
loadVariables()
377

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Questions and answers

This manual is also suitable for:

Flash mx

Table of Contents