You can extend the methods and event handlers of the MovieClip class by creating a subclass. For
more information, see "Assigning a class to a movie clip symbol" in Using ActionScript in Flash.
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());
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);
/* params.txt includes the following text
var1="hello"&var2="goodbye"&done="done"
*/
See also
MovieClip.loadMovie(), MovieClip.loadVariables(), loadVariablesNum(),
MovieClip.unloadMovie()
createEmptyMovieClip()
. The
setInterval()
MovieClip.loadVariables()
target_mc
function is used
.
done
541
Need help?
Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?