Preloaded files dont load instantly!

I have a photogallery which preloads all the photos, and then there are buttons on the side that you can press to change the photo. A blank MC called photoholderMC is what the photos are loaded into. When a button is pressed, it fades photoholderMC’s alpha to zero , then loads the next photo into photoholderMC, then fades photoholderMC’s alpha to 100.

My problem is that although all the images are cached (i know they are being cached because i checked IE temp files) they are not loaded into photoholderMC instantly. So photoholder will start to tween to _alpha=100 before the photo is finished being loaded into it. The result is that when I press a button, the image fades out, then its blank for a second or so, then the image appears at about 50% alpha and fades to 100 alpha. I’m guessing the photo does not load instanty because it takes time for Flash to access the chached photo from the hard drive. I’de be willing to bet that if you viewed the website froma computer with a really slow hard drive that you would not see the alpha fade at all, the image would appear after photoholderMC has already reach 100 alpha.

I’m using this code on each button:

this.onEnterFrame = function() {
t = photoholder.getBytesTotal();
l = photoholder.getBytesLoaded();
percent = (l/t)*100;
if (t > 10) {
if (percent == 100) {
fade code…
So it should not start the fade until the image is loaded… What gives?

well, the whole point of preloaders is to make animations more fluid. There must be something wrong with your code or the button which activates this code. I would have to see more to give a definite answer.