Question
trying to preload swfs
Hello,
i have a main swf that i'm trying to preload other swf's into. i'm trying to add a Listener to the MovieClipLoader. i'm using flash cs3 and got the code from livedocs here: http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00001993.html here">here
here's my code
this.createEmptyMovieClip("swf_mc", 999);
var myMCL:MovieClipLoader = new MovieClipLoader();
//create the listener object
var mcListener:Object = new Object();
mcListener.onLoadError = function(target_mc:MovieClip, errorCode:String, status:Number) {
trace("error loading: " + errorCode + " " + status);
}
mcListener.onLoadStart = function(target_mc:MovieClip){
trace("onLaodStart: " + target_mc);
}
mcListener.onLoadProgress = function(target_mc:MovieClip, numBytesLoaded:Number, numBytesTotal:Number) {
var numPercentLoaded:Number = numBytesTotal / numBytesLoaded * 100;
trace("bytes loaded: " + numPercentLoaded + "% " + " of " + numBytesTotal);
}
mcListener.onLoadComplete = function(target_mc:MovieClip, status:Number) {
trace("onLoadComplete: " + target_mc);
}
myMCL.addListener(mcListener);
myMCL.loadClip("dante_montage.swf", swf_mc);
i get error messages:
1046: Type was not found or was not a compile-time constant: MovieClipLoader.
for the following line of code-
var myMCL:MovieClipLoader = new MovieClipLoader();
and i get this message:
1180: Call to a possibly undefined method MovieClipLoader.
for this line of code-
myMCL.loadClip("dante_montage.swf", swf_mc);
thanks!
i have a main swf that i'm trying to preload other swf's into. i'm trying to add a Listener to the MovieClipLoader. i'm using flash cs3 and got the code from livedocs here: http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00001993.html here">here
here's my code
this.createEmptyMovieClip("swf_mc", 999);
var myMCL:MovieClipLoader = new MovieClipLoader();
//create the listener object
var mcListener:Object = new Object();
mcListener.onLoadError = function(target_mc:MovieClip, errorCode:String, status:Number) {
trace("error loading: " + errorCode + " " + status);
}
mcListener.onLoadStart = function(target_mc:MovieClip){
trace("onLaodStart: " + target_mc);
}
mcListener.onLoadProgress = function(target_mc:MovieClip, numBytesLoaded:Number, numBytesTotal:Number) {
var numPercentLoaded:Number = numBytesTotal / numBytesLoaded * 100;
trace("bytes loaded: " + numPercentLoaded + "% " + " of " + numBytesTotal);
}
mcListener.onLoadComplete = function(target_mc:MovieClip, status:Number) {
trace("onLoadComplete: " + target_mc);
}
myMCL.addListener(mcListener);
myMCL.loadClip("dante_montage.swf", swf_mc);
i get error messages:
1046: Type was not found or was not a compile-time constant: MovieClipLoader.
for the following line of code-
var myMCL:MovieClipLoader = new MovieClipLoader();
and i get this message:
1180: Call to a possibly undefined method MovieClipLoader.
for this line of code-
myMCL.loadClip("dante_montage.swf", swf_mc);
thanks!