i  have set up a thumbnail image gallery that drags images from an external
xml file, however now i have come the point of adding a preloader, i want to
add a preloader to each of the thumbnails, however it only seems to work for
one thumbnail or image, if i just target [0] it works fine, but when i add
the preloader to all my image containers and then try to remove them all it
trips up, 

 

many thanks in advance, any help greatly appreciated.

 

my code is below;

 

my_images=myXML.IMAGE;

                                                my_total=my_images.length();

 

                                                function callThumbs():void {

                                                                for (var
s:Number = 0; s < my_total; s++) {

 
var thumb_url=my_images[...@small;

 
var thumb_loader = new Loader();

 
thumb_loader.load(new URLRequest(thumb_url));

 
thumb_loader.contentLoaderInfo.addEventListener(Event.COMPLETE,
thumbLoaded);

 
//add preloader to the container

 
var preloader:starPreloader = new starPreloader();

 
container1.addChild(preloader);

 
container1.preloader=preloader;

 


 
thumb_loader.name=s;

 
container1.buttonMode=true;

 
thumb_loader.y = (100+5)*s;

 
zoom.small.addChild(container1);

 
container1.addEventListener(MouseEvent.CLICK, callFull);

 
loadedImages ++; 

 

                                                                }

                                                }

 

                                                function
thumbLoaded(e:Event):void {

                                                                var
my_thumb:Loader=Loader(e.target.loader);

                                                                

                                                                var
holder:MovieClip=container1[loadedImages];

                                                                

 
TweenLite.to(container1.preloader, 1, {scaleX: 0, scaleY: 0, alpha: 0,
onComplete:thumbFinished, onCompleteParams:[container1.preloader, holder]});

                                                                

 
container1.addChild(my_thumb);

                                                }

                                                

                                                function
thumbFinished(preloader:MovieClip, container1:MovieClip):void {

 
container1.removeChild(preloader);

                                                                //Remove the
preloader 

                                                }

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to