Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Flash 9 loader - external Jpegs very slow

Status
Not open for further replies.

kazaneh

Technical User
Mar 2, 2004
22
0
0
IE
Hi there,
I'm loading photos in my Loader when the event on(RollOver) is raised in the thumbnails. It is very straight forward but the external JPEGs take ages to load. I have optimised them in Photoshop and the biggest that I have is 30k... pretty small.

Anybody know how can I improve that? Maybe another format?? Pre-loading the photos??

I could include the photos in the libray and use different layers but I would prefer to use the external files since is easier to mantain.

Thanks everybody!!!! :)
 
Hi Kenneth,
It's only one line for each thumbnail.
-----------------------------------------------------------
on(rollOver)
{

this.ldPhoto.contentPath = "photo1.jpg";
}

----------------------------------------------------------

Thanks for your help.
Kazan
 
OK, so you're using the Loader component, that's fine. But you're loading the JPEG on rollOver. If you want to do that you should preload your JPEG, because the user expects something happens instantly on rollOver.

Kenneth Kawamoto
 
ok, that sounds good!!

You mean pre-load the photos when I'm loading the form for example. To be honest with you is the first time that I do this kind of things with flash.

Something like that??

on(load)
this.ldPhoto.contentPath = "photo1.jpg";
this.ldPhoto.contentPath = "photo2.jpg";
this.ldPhoto.contentPath = "photo3.jpg";.....

Thanks!!
 
It's not that simple I'm afraid!

Move everything to frame 2 onwards, then place the following code in the frame 1. This code will load JPEG images in the Array in sequence and when it's done moves onto the frame 2.
Code:
// AS2 main timeline
var arrPhotos:Array = ["photo1.jpg", "photo2.jpg", "photo3.jpg"];
var photoCnt:Number = arrPhotos.length;
var loadingID:Number = 0;
this.createEmptyMovieClip("mcTemp", 1);
var mcl:MovieClipLoader = new MovieClipLoader();
var lo:Object = new Object();
mcl.addListener(lo);
lo.onLoadComplete = function(mc:MovieClip):Void  {
	trace(mc._url+" loaded");
	trace("***");
	loadingID++;
	if (loadingID<photoCnt) {
		loadPhoto(loadingID);
	} else {
		trace("All loading completed");
		trace("***");
		mcTemp.unloadMovie();
		gotoAndStop(2);
	}
};
function loadPhoto(id:Number) {
	mcl.loadClip(arrPhotos[id], mcTemp);
}
loadPhoto(loadingID);
stop();
//

Kenneth Kawamoto
 
Hi Kenneth,
I really appreciate your help!!!

I have to use just 6 photos, so I have include them in the library and works perfect.

Now I have to find out a solution for my other problem. I think that I will make a new post for the slow issue that I have to load the main page.

Thanks again man!!
Kazan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top