If you want to load variables into a target MovieClip, use
loadVariablesNum()
Example
The following example loads information from a text file called params.txt into the main
Timeline of the SWF at level 2 in Flash Player. The variable names of the text fields must match
the variable names in the params.txt file. The
progress of the data being loaded into the SWF. The script checks for a variable in the params.txt
file named
.
done
loadVariablesNum("params.txt", 2);
function checkParamsLoaded() {
if (_level2.done == undefined) {
trace("not yet.");
} else {
trace("finished loading. killing interval.");
trace("-------------");
for (i in _level2) {
trace(i+": "+_level2[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
getURL(), loadMovie(), loadMovieNum(), loadVariables(), MovieClip.loadMovie(),
MovieClip.loadVariables(),
.
LoadVars.load()
loadVariables()
function is used to check the
setInterval()
instead of
loadVariablesNum()
379
Need help?
Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?