595 posts It's just life. Just live it.
  • Top Monthly Author
  • Trendsetter
  • Weekly Top Seller
  • Elite Author
+11 more
Themes-Dojo
says

Hi. I’m working on a slideshow and i want to load all the images at once like in this gallery but I don’t know how to do it. Can you help me? Please!

3072 posts
  • Affiliate Level 3
  • Author Level 6
  • Collector Level 2
  • Weekly Top Seller
+7 more
wickedpixel
says

it’s not a good idea to load all the files at the beginning… makes the user to get bored

595 posts It's just life. Just live it.
  • Top Monthly Author
  • Trendsetter
  • Weekly Top Seller
  • Elite Author
+11 more
Themes-Dojo
says

this is the request so i have to do it :)

723 posts
  • 7 Years of Membership
  • Affiliate Level 3
  • Author Level 6
  • Collector Level 2
+5 more
BigZ
says
counter = 0
my_mc = new MovieClipLoader();
listener = new Object
my_mc.addListener(listener)

listener.onLoadInit = function(){
    counter+=1
    my_mc.loadClip(image[counter], bigImage[counter]);
}
my_mc.loadClip(image[counter], bigImage[counter]);

in this example “image” is an array with the paths to the images. “bigImage” is an array containing the target movieclip.

You could make put an if statement somewhere, like:

if(counter >= total){
       //start gallery
}
595 posts It's just life. Just live it.
  • Top Monthly Author
  • Trendsetter
  • Weekly Top Seller
  • Elite Author
+11 more
Themes-Dojo
says

Thank you BigZ ;)

2486 posts Premium Scripts, Plugins and Themes
  • 8 Years of Membership
  • Affiliate Level 5
  • Author Level 8
  • Beta Tester
+9 more
LucidStudios
says

Here is furnished version of BigZ’s code:


var counter:Number = 0;
var my_mc:MovieClipLoader = new MovieClipLoader();
var listener : Object = new Object();
my_mc.addListener(listener)

function startLoadingImages():Void{
   loadNextImage();
}

function loadNextImage():Void{
   my_mc.loadClip(images[counter], bigImage[counter]);
}
listener.onLoadInit = function(){
    if( ++counter < images.length ){
      loadNextImage();
    }
    else{
      initGallery();
    }

}
startLoadingImages();
723 posts
  • 7 Years of Membership
  • Affiliate Level 3
  • Author Level 6
  • Collector Level 2
+5 more
BigZ
says

yeah saafi, I thought he could think of that himself ;) anyways nice refined code :)

glad to be able to help.

595 posts It's just life. Just live it.
  • Top Monthly Author
  • Trendsetter
  • Weekly Top Seller
  • Elite Author
+11 more
Themes-Dojo
says

Thank you both of you ;)

3072 posts
  • Affiliate Level 3
  • Author Level 6
  • Collector Level 2
  • Weekly Top Seller
+7 more
wickedpixel
says
var my_mc:MovieClipLoader = new MovieClipLoader();
var listener : Object = new Object();
my_mc.addListener(listener)

function loadNextImage():Void{
   my_mc.loadClip(images[images.length], bigImage[images.length]);
}

listener.onLoadInit = function(){
    images.pop()
    if(images.length > 0) {
        loadNextImage();
        } else {
            initGallery();
        }
}
loadNextImage();

:D

595 posts It's just life. Just live it.
  • Top Monthly Author
  • Trendsetter
  • Weekly Top Seller
  • Elite Author
+11 more
Themes-Dojo
says

I will try it tomorrow, it’s too late now :P

by
by
by
by
by
by