all groups > flash actionscript > october 2006 >
You're in the

flash actionscript

group:

loading jpegs with progress bar


loading jpegs with progress bar melodywestern
10/23/2006 11:44:07 PM
flash actionscript:
I am having trouble when loading external jpegs into an empty movie on the main
timeline. The jpegs load but I'm trying to assign a preloader to the empty
movie clip as the jpegs can have a large filesize.
When the page initially loads it has a main preloader which works fine it then
loads the page and the first jpeg I have assigned to load into the movie clip
loads WITH the preloader as I want it to.
However when I click on the thumbs to load other jpegs the progress bar does
not appear and therefore they are not preloading. Does anyone have any idea why.

Here is the AS on the main timeline:

holder_mc.loadMovie("Images/1.jpg");

this.onEnterFrame = function() {
l = holder_mc.getBytesLoaded();
t = holder_mc.getBytesTotal();
p = Math.round((l/t)*100);
if (p<100) {
preloaderPic_mc.gotoAndStop(p);
} else {
preloaderPic_mc._visible = false;
this.onEnterFrame = null;
}
};

The AS on each of the thumbnail buttons:

on(release) {
holder_mc.loadMovie("images/1.jpg");
}
on(rollOver) {
pic1_btn._alpha-=50
}
on(rollOut) {
pic1_btn._alpha+=50
}


Thankyou in advance
Re: loading jpegs with progress bar AustinHurst
10/24/2006 12:00:14 AM
Re: loading jpegs with progress bar melodywestern
10/24/2006 12:10:46 AM
Re: loading jpegs with progress bar AustinHurst
10/24/2006 12:17:03 AM
Im pretty certain if you use the loader component to call each jpeg, then an
initial preload function in the first frame of the timeline would preload the
component data as well as the timeline data before moving to frame 2.
Re: loading jpegs with progress bar melodywestern
10/24/2006 12:27:51 AM
I see. Thankyou for the quick response. I am unfamiliar with components but
have been playing with the said component. Can you tell me how I can target the
component to load the other jpegs from my thumbnail buttons? As from what I
have gathered so far the Loader component only loads one file. Is this true?
Re: loading jpegs with progress bar AustinHurst
10/24/2006 12:52:50 AM
Actually yes, the loader component can only load a specific file into an area.
I misread the fact you were trying to load images after pressing a button. I'm
willing to help you more, but I'm not going to be on these forums. you can
e-mail me here: austinhurst(at)gmail(dot)com of course replace the ()s with the
actual symbols.

Austin
AddThis Social Bookmark Button