Skip to main content
Participant
October 23, 2006
Question

loading jpegs with progress bar

  • October 23, 2006
  • 3 replies
  • 287 views
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
This topic has been closed for replies.

3 replies

Participant
October 24, 2006
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
Participant
October 24, 2006
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.
Participant
October 24, 2006
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?
Participant
October 24, 2006
I would use the loader component to pull in your images and then your main preloader will treat them as part of the timeline.
Participant
October 24, 2006
So this would negate the use of a preloader to preload each jpeg?