How to use a preloader for external images in flash
Author: 2nd bee | Filed under: tutorials, webdesignI made a site for some friends and i needed to put external images. Because they were too big i wanted to use a preloader. How did i make it? Follow this post and see.
1. First save all the images on a folder (for example /images - on the root of the site—see the previous post - how to use actions in photoshop)
2. Usually i make some thumbnails for all the images and then i use them as buttons for loading the big images…on every button i use this kind of action script
on(press){
gotoAndStop(113);
—this is where the empty movieclip is located(if it’s different from the buttons frame, if not you can delete this line)
loadMovie(”images/test001.png”, load_mc);
—this is how the image is loading on the movieclip—the path to the image and the destination
}
3. i used two objects, besides the buttons, a movieclip named load_mc, and a preloaderbar taken from the components panel
ps. put the progressbar and the movieclip in different layers
4. as you can see in the images below, i made some changes of the parameters for the preloaderbar component:
- mode = polled
- source = load_mc (this is the movieclip where all the images are loading in) and one change on the schema- found on the component inspector panel
- kind= autotrigger
and you are done.
if the images aren’t loading, make sure you save them with saveforweb in photoshop (they have to be nonprogressive) and if you need any help with flash..ask me and i’ll try to answer or find someone who will
until next time…. kisses!




hi! very useful
one question:
the pre-loader stays there, is there any code so the bar disappears when it finish downloading?
thank you!
HI “V” …
you can put this action on the progressbar
on (complete) { this.visible = false;
}
let me know if it worked
have a great day
Hi,
I used your technique for preloading my pictures on a MC and the preloader works fine for the first picture loaded… then when I load another JPG in the same MC the progress bar don’t start over. How could I get the progress bar to restart the loading each time I load a new picture in my MC?
If you need any other informations, let me know!
Thanks a lot!
Hi Maxime
it can happen not to work…it’s a bug in flash with the progress bar…but i can tell you one more method to do the exact same thing. But u have to wait a little(until the weekend)…i hope i can do it today but i can’t promise…
hi,
i’m stuck. My images are loading fine but the progress bar is (i think) loading my whole swf file instead of the individual images - either that or it’s just sitting at 100% loaded the entire time.
Is the source allocated to load_mc the only way the progress bar is connected to the movie clip?
Hi K..
As u can see Maxime has the same problem…i will try to resolv the problem in the following days.
Take care
so…i think i figured it out.because of the bug, u have to do like this:
1. u have to create a separate copy of the mc and progressbar for every picture. so that u can give the progressbar another source. u can put the mc and progress bar at different frames and on the thumb u have to put this actionscript
on(press){
gotoAndStop(framenumber);
loadMovie(”images/test001.png”, _root.load_mc);
}
change the source on the progressbar load_mc, load_mc2 or with the picture name so it’s easier to know where a picture is loaded
Tell me if it worked..
if this isn’t ok u can try this loader free
download
i have a problem like this the 1 image load perfect but with the second the preload don’t work and not turn invisible like the first image
Thanks
Hi Victor.
Did you tried the methods above?
Please use this loader: download
This is a much happier component that the default one.
If you are unable to understand how to use the component please write me.
Take care.