PDA

View Full Version : preloading an external swf inside movieclips



bongbox
September 17th, 2005, 10:08 PM
lets say i have an external swf file and i load it to a movieclip name holder mc how do i preload it?

rhamej
September 17th, 2005, 11:48 PM
You can put a preloader in the first fame of each external swf
http://www.kirupa.com/developer/mx/percentagepreloader.htm

Or build a movie clip prelaoder that is in the main movie and call it with this
http://www.kirupa.com/developer/actionscript/moviecliploader.htm

Dasmonstrum
November 17th, 2005, 11:48 AM
Hi There!

and please, how can I first load all external swf, at the main movie, is a simple preloader?!

Thanks

vikesh
November 17th, 2005, 12:22 PM
Hi There!

and please, how can I first load all external swf, at the main movie, is a simple preloader?!

Thanks

Yo Buddy ! hola

Yep i'll give u a short tip how to do tat man ! :)

if u got many external swf if u want to load them so here it is..

var panoramaMovie:Array = ["accueil-0-1-v.swf", "salledebains-0-1-v.swf"]
var movieSection:Array = ["accueil", "salledebains];

function setSwf(a, b) {
popup_mc._visible = 1;
cache_mc._visible = 1;
//names of folder where the External swf are.
var pathFinder:String = "swf/"+movieSection[a]+"/";
_root.movieToLoad = pathFinder+panoramaMovie[b];
}

function whichMovieToSet(a, b) {
setSwf(a, b);
var whichMovie:String = _root.movieToLoad;
movieLoader();
loadMovie(whichMovie, _root.popup_mc.mcCanvas2);
}

function movieLoader(){

this.onEnterFrame = function (){
var loadBytes = _root.popup_mc.mcCanvas2.getBytesLoaded();
var totalBytes = _root.popup_mc.mcCanvas2.getBytesTotal();
var Percentage = Math.floor( (loadBytes / totalBytes) * 100);
this.createTextField("txt",this.getNextHighestDepth,100,250,100,20);
txt.text = Prcentage+ '%';
if(loadBytes == totalBytes) {
delete this.onEnterFrame;
txt.removedTextField();
}

}

}

--------------------------------------------------
HERE IT IS BUDDY :)

stringy
November 17th, 2005, 02:59 PM
This may also be of help
http://www.kirupa.com/forum/showthread.php?t=185881
There is also a good thread here
http://www.kirupa.com/forum/showthread.php?t=197340
you could adapt Barns function to fake a preloader by comparing the current movie loading to the array length