Creating a Preloader for loading a JPEG

Hey, I need to create a preloader (basic one) for loading a JPEG file so that once the file is loaded I can manipulate it’s properties…

At the moment I have the Images loading into MC which is contained in another movie clip MCholder say.

How do I go about creating a preloader since the gettotalbytes is only available after it’s loaded it always returns 0 :-/

?

Thanks

On the main timeline:

[AS]
Mcholder.MC.loadMovie(“image.jpg”);
Mcholder.MC._visible = false;
Mcholder.MC.onEnterFrame = function(){
l = this.getBytesLoaded();
t = this.getBytesTotal();
if(l==t){
delete this.onEnterFrame
this._visible = true;
//manipulate here.
}
}
[/AS]

Hmm would that work with a jpeg though?

Lol, sorry, that should’ve been .jpg :stuck_out_tongue: edits post

Ahh ok i’ll :smiley:

I’ll try it thanks

Hmm as i suspected it didn’t work :frowning: there HAS to be a way surely?!

That pretty much HAS to work :-\ Are you sure the image isn’t progressive ? Are you sure the filename is correct ? Are you sure it’s in the same directory as the swf file ? Are you sure the path is correct ? Are you sure you placed it on the main timeline ? Are you sure you gave the correct instance names ? …

If the answer to all is yes, post your fla and image or send it to me so I can have a look at it.

It isn’t progressive as i tried just now to simply load it in a test flas and it loads fine, thr file name will be correct as it DOES load you see it’s an image gallery and the url of all the images are found in a mySQL database which i connect to through perl… I’m not sure whether I can place it on the main timeline the whole thing is 500kb so you can download it from

www.dream-odyssey.com/dreamviewer.zip

Basically if you drill down to the reelMCImages movieclip you’ll find a clip called MCThumb1 an instance of ReelMCImage check out the action for that , that is where i placed your code snippet

the actual container it loads in can be found at _root.ImgLayer.imgcont

The images are all on the web server so they’ll just download

Thanks

anyone?