OK, I thought this should be a relatively simple thing, but it’s been giving me fits for the last 2 days. Here’s the project…there’s a series of HTML pages that will appear with a button that leads to a more in-depth description (optional for those who need it) that is done with Flash. I need to have an external swf load into an empty movieClip container which will have a playback controller attached to it along with a preloader that will show the progress % while the external swf is loading. I got the preloader to start and the swf to play in the container, but the problem is that the external swf starts before the preloader gets all the way to 100%. It starts at 12% and then the preloader stays visible (still showing progress) and reaches 100% at the same time the external swf ends.
var myMCL:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();
var container:MovieClip = this.createEmptyMovieClip("container", 50);
var contentContainer:MovieClip = this.createEmptyMovieClip("content", 5);
myMCL.addListener(myListener);
myListener.onLoadProgress = function(target_mc:MovieClip, getBytesLoaded:Number, getBytesTotal:Number) {
container._visible = true;
var preloadPercent:Number = Math.round((getBytesLoaded/getBytesTotal) * 100);
container.preloader.gotoAndStop(preloadPercent);
container.percentTotal.text = preloadPercent;
}
myListener.onLoadComplete = function(target_mc:MovieClip) {
container._visible = false;
}
myMCL.loadClip("preloader.swf", "container");
myMCL.loadClip("Test Movie.swf", "content");
I haven’t even gotten to the point where I’m ready to add my code for the controller. If there’s anyone out there who knows how I could get this working, I’d be incredibly grateful.