User Guide

loadVariablesNum() 379
If you want to load variables into a target MovieClip, use loadVariables() instead of
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
setInterval() function is used to check 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()