EasyManua.ls Logo

MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE - Localtoglobal (Movieclip.localtoglobal Method)

MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE
780 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
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.

Table of Contents

Related product manuals