PDA

View Full Version : Preloader for container movie



sosADAMsos
February 23rd, 2007, 04:05 PM
I'm trying to load an external swf in a movie container. I made a preloader in the external swf so it would show it loading, but when the external swf tries to load the preloader will blink several times before the swf will load. anyone know why this is? If I take out the preloader it will work fine (but I would like to use a preloader).

Does anyone have a preloader that would work for an external swf loading into a container?

Thanks in advance!

Tempest811
February 23rd, 2007, 04:09 PM
I recommend using the MovieClipLoader
Tutorial: http://flash-creations.com/notes/dynamic_loadjpg.php (http://flash-creations.com/notes/dynamic_loadjpg.php)
It's not super simple but it is one of the best ways to go about this.

a working example of mine would be this:


function loadThumb(){
var loadListener:Object = new Object();
var thumbLoader:MovieClipLoader = new MovieClipLoader();
thumbLoader.loadClip("yourClip.swf", targetMC);
loadListener.onLoadProgress = function(target, bytesLoaded, bytesTotal):Void{
// Do this while its loading... or tell preloader bar to display % loaded
}
loadListener.onLoadComplete = function(){
// Do this once its done
}
thumbLoader.addListener(loadListener);
}

project107
February 23rd, 2007, 05:47 PM
Adam,
couldn't it be the _root. references in the preloader code?