all groups > flash actionscript > november 2006 >
You're in the

flash actionscript

group:

loading external swf


loading external swf ella918
11/22/2006 8:31:44 PM
flash actionscript:
I'm loading an external swf using loadClip. My problem is that this swf loops
which I don't want. I don't have the .fla for it so I can't modify the
original file. I was trying to detect when the loaded swf reaches the last
frame, and then stopping it, but I'm not having any luck. Any suggestions on
what I'm doing wrong and how to fix it? I've attached the code of my last
attempt.

Thanks.


this.createEmptyMovieClip("mcSMS", this.getNextHighestDepth());
var mclListener:Object = new Object();
mclListener.onLoadInit = function(target_mc:MovieClip) {
trace("movie loaded");
}
var image_mcl:MovieClipLoader = new MovieClipLoader();
imgae_mcl.onLoadError = function(target_mc:MovieClip, errorCode:String,
httpStatus:Number) {
trace(">> loadListener.onLoadError()");
trace(">> ==========================");
trace(">> errorCode: " + errorCode);
trace(">> httpStatus: " + httpStatus);
}
image_mcl.addListener(mclListener);
image_mcl.loadClip("myMovie.swf", mcSMS);
mcSMS._x=160;
mcSMS._y=200;
mcSMS.onEnterFrame = function() { // check on each frame
if (mcSMS._currentframe == mcSMS._totalframes) { // reached the end of the mc
mcSMS.stop();
delete this.onEnterFrame; // stop the check on each frame
}
}
Re: loading external swf kglad
11/22/2006 10:52:09 PM
AddThis Social Bookmark Button