This content has been marked as final. Show 6 replies
Yes Flash hasn't had a chance to begin loading the jpg and receive information about it eg. bytesTotal etc when you set totalBytes.
If you have Flash MX 2004+, I recommend you have a look at the MovieClipLoader class. It comes with event handlers such as onLoadProgress that you can use to compare bytestLoaded with bytesTotal every time some more content has loaded.
Unfortunately I'm using FlashMX, so the movieClipLoader class is unavailable to me... SO there's really on way to fix this???
no no there's always a way, i was just pointing you in the direction of the easiest way.
the first thing you need to do is check getBytesLoaded at regular intervals rather than in a loop on a frame. this can be achieved several ways - i've used setInterval in the example i prepared for you.
the second thing you need to do is check that getBytesTotal has been received from the jpg okay - this can be checked by ensuring that getBytesTotal>4, which is the size of an empty movie clip.
the code i have attached is independent of your xml code, which was really confusing things, as it is unrelated to your loader code (one problem at a time!). once you're happy with your loader code, then you can integrate it with your working xml code.
I could be wrong but in your code you seem to be loading all the images into just one variable. So that each time you loop through the for loop you are replacing the one which came before instead of creating an additional variable to hold the nect image for later retrieval.
But like I said I could be wrong. It's late and I;m kind of seeing double but I don't see where you're applying the "i" to a new named variable or even an array.
Your trace shows the different names coming in but you're slways using the same variable name.
Web - You are correct, I am loading the movie into the same movie clip, but i think it's irrelevant. I'm basically just trying to load them so that they are in the user's cache. In my actual movie I load each jpeg into the same movie clip that's used for a template, and that works fine, so I figured that it should work here also (I could be wrong).
Craig - Thanks for taking the time to write that up, I'll take a look at the code tonight. Once quick question. The commented line that says "insert fully loaded code here", are you referring to my xml code?
no i'm referring to the graphic being fully loaded at that point so there may be specific actions you want performed - eg. remove the loader, start loading the next picture, play a song, who knows?