
MovieClip
487
Example
The following example loads information from a text file called params.txtinto the
target_mc
movie clip that is created by using
createEmptyMovieClip()
. The
setInterval()
function
is used to check the loading progress. The script checks for a variable in the params.txt file
named
done
.
this.createEmptyMovieClip("target_mc", this.getNextHighestDepth());
target_mc.loadVariables("params.txt");
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 params.txt file includes the following text:
var1="hello"&var2="goodbye"&done="done"
See also
loadMovie (MovieClip.loadMovie method)
,
loadVariablesNum function
,
unloadMovie (MovieClip.unloadMovie method)
localToGlobal (MovieClip.localToGlobal method)
public localToGlobal(pt:
Object
) : Void
Converts the
pt
object from the movie clip's (local) coordinates to the Stage (global)
coordinates.
The
MovieClip.localToGlobal()
method allows you to convert any given x and y
coordinates from values that are relative to the top-left corner of a specific movie clip to values
that are relative to the top-left corner of the Stage.
Summary of Contents for Flash Lite 2
Page 1: ...Flash Lite 2 x ActionScript Language Reference...
Page 22: ...22 Contents...
Page 244: ...244 ActionScript language elements...
Page 760: ...760 ActionScript classes...