Download the new Autochrome 2.0 Photography Wordpress Theme.

External JPEG file preloader

— By

Due to popular demands and complaints from many MM forum users when my previous external JPEG preloader went offline, I am bringing back the external JPEG preloader with a new improvised script. I wasn’t sure if people still liked that preloader, so, I am sorry as most of the files went offline while changing web host. You can download the same w/o image (53 kb) or with image (350 kb).

Please note that there is no preloader for the main movie, so you may need to wait for the 17kb main movie on a slow connection. Take note that the improvement is mainly in the fact that the previous image remains shown while the next image is preloaded.

Brajeshwar

Brajeshwar believes in simplicity; pushes the envelop and envisions the betterment of usable and practical solutions.

More by Brajeshwar

  • http://www.dogmatheque.com dogma

    At last i found the jewel i was looking for.
    The code is (relatively) simple to understand (provided you know a bit about Objects), documented and most of all : IT WORKS.
    thanx for this wonderfull little script that really saves my day/week (been figuring for a few days, how to solve that problem).

  • http://www.dogmatheque.com dogma

    At last i found the jewel i was looking for.
    The code is (relatively) simple to understand (provided you know a bit about Objects), documented and most of all : IT WORKS.
    thanx for this wonderfull little script that really saves my day/week (been figuring for a few days, how to solve that problem).

  • ivoht

    Is it also possible to add a progressbar to this loader?

  • ivoht

    Is it also possible to add a progressbar to this loader?

  • http://www.brajeshwar.com Brajeshwar

    >Is it also possible to add a progressbar to this loader?
    Why not, as you see that the percentage indicator is there, besides that just let your progressbar MC to _xscale according to the percentage loaded, simple as a pie. Isn't it. Enjoy!

  • http://www.brajeshwar.com Brajeshwar

    >Is it also possible to add a progressbar to this loader?
    Why not, as you see that the percentage indicator is there, besides that just let your progressbar MC to _xscale according to the percentage loaded, simple as a pie. Isn't it. Enjoy!

  • Nolo

    This can also be used to preload swf files :]

  • Nolo

    This can also be used to preload swf files :]

  • bumpu

    hi,
    can someone please tell me how to call jpeg images from a folder in a computer - in a flash presentation without having to import the files.
    thanks-
    bumpu

  • bumpu

    hi,
    can someone please tell me how to call jpeg images from a folder in a computer - in a flash presentation without having to import the files.
    thanks-
    bumpu

  • http://www.loppen.com Loppen

    tip: check placeholderMc for its width. If its larger than zero then the jpg has been loaded into the placeholderMc. Only then show the loaded jpg. Otherwise you might make the movieClip visible before the jpg is visible in the movieClip.

  • http://www.loppen.com Loppen

    tip: check placeholderMc for its width. If its larger than zero then the jpg has been loaded into the placeholderMc. Only then show the loaded jpg. Otherwise you might make the movieClip visible before the jpg is visible in the movieClip.

  • Mayur

    Brajeshwar, i used some part of your code and tried to load multiple jpegs in a target clip and i found that on a dsl connection it loads but it wont load on the dial-up. That means that there is some problem in the loop to check for imagebytes. Can u tell me why I would have this problem. Thanks a lot.

  • Mayur

    Brajeshwar, i used some part of your code and tried to load multiple jpegs in a target clip and i found that on a dsl connection it loads but it wont load on the dial-up. That means that there is some problem in the loop to check for imagebytes. Can u tell me why I would have this problem. Thanks a lot.

  • http://www.splitpersonality.com Bo

    I'm trying to use this application for showing over 100 jpegs. I tried to change the "var lastImg = 199" inside the "preloadjpg.as"
    but it still doesnt work. I can see only up to 19 jpegs.

    can u help

  • http://www.splitpersonality.com Bo

    I'm trying to use this application for showing over 100 jpegs. I tried to change the "var lastImg = 199" inside the "preloadjpg.as"
    but it still doesnt work. I can see only up to 19 jpegs.

    can u help

  • Deborah M

    Hello,
    is there a way to call up with actionscript dynamic image filenames off a coldfusion page from the dynamic name #image# and have the flash post it? the reason is so that I can have the picures SQLed together with my data that goes with the picture. If you can help me figure this out, I'd be very happy. I got the coldfusion page ready, I just need to know how to call it into flash. I gave the image the name &picture and it works only with text so far. But I haven't reached a level of getting it work work with images. please help, I got a p[roject on the go....and I'm such an extreme nubee, I barely know flash, just very simple stuff in actionscript.

  • Deborah M

    Hello,
    is there a way to call up with actionscript dynamic image filenames off a coldfusion page from the dynamic name #image# and have the flash post it? the reason is so that I can have the picures SQLed together with my data that goes with the picture. If you can help me figure this out, I'd be very happy. I got the coldfusion page ready, I just need to know how to call it into flash. I gave the image the name &picture and it works only with text so far. But I haven't reached a level of getting it work work with images. please help, I got a p[roject on the go....and I'm such an extreme nubee, I barely know flash, just very simple stuff in actionscript.

  • igor

    Whats the actual method used to find out the bytes total of the JPG image thats loading....

    ??

  • igor

    Whats the actual method used to find out the bytes total of the JPG image thats loading....

    ??

  • http://www.brajeshwar.com Brajeshwar

    Igor; When a SWF file is loaded into a target movie clip, you can use the target path of that movie clip to target the loaded SWF/JPEG file. A SWF file or image loaded into a target inherits the position, rotation, and scale properties of the targeted movie clip. The upper left corner of the loaded image or SWF file aligns with the registration point of the targeted movie clip. So as loading a JPEG is exactly like loading a SWF, you get all the properties like getBytesLoaded, getBytesTotal of the target MC which we are doing here to get the totalBytes and bytesLoaded of the JPEG. With the new Flash MX 2004, it is though suggested and advised to use the MovieClipLoader class instead and leave alone loadMovie and loadMovieNum for just doing the "loading" of SWF/Image to target clips and levels.

  • http://www.brajeshwar.com Brajeshwar

    Igor; When a SWF file is loaded into a target movie clip, you can use the target path of that movie clip to target the loaded SWF/JPEG file. A SWF file or image loaded into a target inherits the position, rotation, and scale properties of the targeted movie clip. The upper left corner of the loaded image or SWF file aligns with the registration point of the targeted movie clip. So as loading a JPEG is exactly like loading a SWF, you get all the properties like getBytesLoaded, getBytesTotal of the target MC which we are doing here to get the totalBytes and bytesLoaded of the JPEG. With the new Flash MX 2004, it is though suggested and advised to use the MovieClipLoader class instead and leave alone loadMovie and loadMovieNum for just doing the "loading" of SWF/Image to target clips and levels.

  • http://www.visual-basic.com.ar/ activex

    Where can I find the method to decompress JPEG (the algo)?

  • http://www.visual-basic.com.ar/ activex

    Where can I find the method to decompress JPEG (the algo)?

  • Acanty

    Niccceee pagee

  • Acanty

    Niccceee pagee

  • Numit

    Yeeeahd, it's csool

  • Numit

    Yeeeahd, it's csool

  • Buddha

    How can i have hand cursor over a input textbox?
    I should also be able to type text in it.In
    short i need to use hand cursor to select textbox instead of blinking cursor.

  • http://instantanees.free.fr Mateo

    Hello,
    I've just a question. How can i do to download all jpeg at the beginning without to click on the button. Thanks a lot.....

  • http://instantanees.free.fr Mateo

    Hello,
    I've just a question. How can i do to download all jpeg at the beginning without to click on the button. Thanks a lot.....

  • Stephen Boyd

    Hey thanks man, I've been trying to achieve just this effect for a couple of weeks now. Now I see it, it's an obvious, if rather slick, solution. Write the preloader on the fly each time the image is loaded.

  • Stephen Boyd

    Hey thanks man, I've been trying to achieve just this effect for a couple of weeks now. Now I see it, it's an obvious, if rather slick, solution. Write the preloader on the fly each time the image is loaded.

  • http://www.webro.ro morfis

    Nice work! You'd think the code is rather obvious yet ... here I am :D

  • http://www.webro.ro morfis

    Nice work! You'd think the code is rather obvious yet ... here I am :D

  • pirco

    the number of external JPGs that i need to load into my flash movie varies. is there a way to find out how many files will be loaded without having to hardcode the number of images into the action script? i would prefer not even to use a variable, instead, it would be nice if there is a way for the script to "figure out" how many images will be loaded. i know this might get into file system scripting (or something) but i thought it would be possible to add an error check into the actionscript that detects that the next image to be loaded does not exist and then stops loading.
    make sense?

  • pirco

    the number of external JPGs that i need to load into my flash movie varies. is there a way to find out how many files will be loaded without having to hardcode the number of images into the action script? i would prefer not even to use a variable, instead, it would be nice if there is a way for the script to "figure out" how many images will be loaded. i know this might get into file system scripting (or something) but i thought it would be possible to add an error check into the actionscript that detects that the next image to be loaded does not exist and then stops loading.
    make sense?

  • http://brajeshwar.com/ Brajeshwar

    Yes Pirco, it makes perfect sense. The only hiccup is that ActionScript do not as of now have a way to check that and neither does it return an error when a file do not exist. So, you have to rely on third party server side script (wrapper in case of offline apps) to do that.

  • http://brajeshwar.com/ Brajeshwar

    Yes Pirco, it makes perfect sense. The only hiccup is that ActionScript do not as of now have a way to check that and neither does it return an error when a file do not exist. So, you have to rely on third party server side script (wrapper in case of offline apps) to do that.

  • THanx
  • http://www.PrashantPoladia.com Prashant Poladia

    Damn kewl Script!!!
    Its working really well. Thanks Braj.

  • http://www.PrashantPoladia.com Prashant Poladia

    Damn kewl Script!!!
    Its working really well. Thanks Braj.

  • Kazik

    Indeed a beautiful piece of code. I was close to going mad writing a jpeg preloader myself, a few more hours and i would definitely have to say 'good bye' to my mental health and then i found this: exactly what i was looking for. Works perfect for me, easy to tweak, thx a lot!!

  • Kazik

    Indeed a beautiful piece of code. I was close to going mad writing a jpeg preloader myself, a few more hours and i would definitely have to say 'good bye' to my mental health and then i found this: exactly what i was looking for. Works perfect for me, easy to tweak, thx a lot!!

  • Ron Zanos

    Where can I download this preloader? The links seem to not work.

    It looks very good, please let me know how I can download it.

    Thank you.

  • Ron Zanos

    Where can I download this preloader? The links seem to not work.

    It looks very good, please let me know how I can download it.

    Thank you.

  • Lester

    How can I use this preloade in thumbnails? I mean, display all the thumbnails as buttons instead of the PREV | NEXT buttons.

  • Lester

    How can I use this preloade in thumbnails? I mean, display all the thumbnails as buttons instead of the PREV | NEXT buttons.

  • Scola

    "How can I use this preloader in thumbnails? I mean, display all the thumbnails as buttons instead of the PREV | NEXT buttons."

    Yeah I need this too! Any help would be GREAT!!!

    scola@westnet.com.au

  • Scola

    "How can I use this preloader in thumbnails? I mean, display all the thumbnails as buttons instead of the PREV | NEXT buttons."

    Yeah I need this too! Any help would be GREAT!!!

    scola@westnet.com.au