The Most Active and Friendliest
Affiliate Marketing Community Online!

“AdsEmpire”/  Direct Affiliate

mx2k4pro > using loader component

crowebird

New Member
affiliate
Im using the loader component to load other .swfs into my site, but I want to be able, to create my own progress bar, does anyone know the code that the progressbar (flash component)... All i need to know is how to get the totalBytes from the loader component, for example, i have home.swf put into the loadercomponent, and I need to find out how I can get the totalBytes from of home.swf through the loader, that way my progress bar will work correctly...

thanks,mike
 
ok never mind about that I got it firgured out...
this is what I used,

Code:
var content_homeLoader:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();
myListener.onLoadStart = function(target_mc:MovieClip) {
	var loadProgress:Object = content_homeLoader.getProgress(target_mc);
};
myListener.onLoadProgress = function(target_mc:MovieClip, loadedBytes:Number, totalBytes:Number) {
	tellTarget ("preloader") {
		gotoAndStop(Math.round(loadedBytes/(totalBytes/Number(100))));
	}
	target_mc._visible = false;
};
myListener.onLoadComplete = function(target_mc:MovieClip) {
	var loadProgress:Object = content_homeLoader.getProgress(target_mc);
	target_mc.unloadMovie();
	gotoAndPlay(4);
};
myListener.onLoadError = function(target_mc:MovieClip, errorCode:String) {
	content_text_box = "Error loading site contents, please try again later";
	_root.showLoading.stop();
};
content_homeLoader.addListener(myListener);
this.createEmptyMovieClip("content_home_mc", 0);
content_homeLoader.loadClip("http://www.wtflash.com/content/stuff.swf", content_home_mc);
stop();

cheers,
mike

<<--Code has been edited-->>
 
Yes, how my site works...

The part of the site that pops up, and the background is all one swf, then the content of the site is another swf, so where it says www.wtflash.com is undergoin re-construction is actully another swf in a swf, that way later, I only have to change part of the site so it wont be as complicated. What I do is load the layout.swf first, then after that is complete I use that code to load the second swf... if you would like to see how mine works, I can make a fla for you

cheers,
 
Mike its cool,
all you need to do is to add some contents to the intro, its blank at present
Temi
 
ok the site is basically complete, execpt for what is going to go on each page, meaning how the site will change when you go to diff parts is complete, so if oyu check it out and click on one of the nav links it will load the next page... tell me what you think, thanks!
 
MI
Back