Dynamic Image Loader

I’m trying to create a dynamic image loader that I can use to show a loading bar for each of my images in my portfolio page. What I want to accomplish is basically here:

http://www.kirupa.com/developer/actionscript/moviecliploader.htm

problem is I don’t have MX 2004, I’m working in MX. Does anyone know where I can find out how to create a dynamic image loader in MX with that loading class? My main problem is that I can’t seem to access my JPG to find out how much of it has loaded. I’m not new to preloaders but obviously if I can’t access AmountLoaded and AmountTotal then I can’t run a preloader. Any help is appreciated. Thanks.

The movieClipLoader was implemented until MX2004. Why not just use a basic preloader using getBytesLoaded and getBytesTotal?


function loadIt(image) {
    holder.loadMovie(image);
    onEnterFrame = function () {
        BL = holder.getBytesLoaded();
        BT = holder.getBytesTotal();
        percent = Math.round(BL/BT*100);
        if (BL == BT && holder._width>1) {
            delete onEnterFrame;
        }
    };
}
loadIt("image.jpg");

[QUOTE=rhamej;1984036]The movieClipLoader was implemented until MX2004. Why not just use a basic preloader using getBytesLoaded and getBytesTotal?


function loadIt(image) {
    holder.loadMovie(image);
    onEnterFrame = function () {
        BL = holder.getBytesLoaded();
        BT = holder.getBytesTotal();
        percent = Math.round(BL/BT*100);
        if (BL == BT && holder._width>1) {
            delete onEnterFrame;
        }
    };
}
loadIt("image.jpg");

[/QUOTE]

I tried that before but for some reason I couldn’t seem to access the image’s BytesLoaded and BytesTotal…I don’t know why, I thought it was some shortcoming with Flash’s treatment of JPG’s. Am I wrong here? If you tell me that you know for sure that I should be able to get those properties for a JPG in MX then I’ll go back to my code and disect it, but I tried applying the normal preloading techniques once before and they wouldn’t work…

[QUOTE=riveroaks;1984517] If you tell me that you know for sure that I should be able to get those properties for a JPG in MX then I’ll go back to my code and disect it[/QUOTE]

I know for sure as does rhamej (or is it now rha ?)

if you get stuck copy/paste your code

[quote=stringy;1984527]I know for sure as does rhamej (or is it now rha ?)
[/quote]:lol: