Search the Community
Showing results for tags 'multiple images'.
-
Hi I'm attempting to replicate the preloader functionality of the demo for LoaderMax, Basically I'm loading multiple images to form a scrolling gallery, with each individual image having its own preloader. I've got a container with the preloader for each image, awaiting the image to load, this is so I can animate that container around whilst the image is loading and the user can see the progress bar in the mean time.. I'm just struggling to get multiple images loading simultaneously to display progress bars at the same time like in the LoaderMax demo.... any advice? var categoryName:String = "portrait"; var maxCons:Number = 2; var numImages:int = 4; var clipArray:Array = []; var imgContainer:MovieClip; var progressBar:MyProgressBar; var queue:LoaderMax = new LoaderMax({maxConnections:maxCons, onProgress:queueProgressHandler, onComplete:queueCompleteHandler, onChildProgress:imageProgressHandler, onChildComplete:imageCompleteHandler }); for (var i:int=0; i<numImages; i++) { queue.append(new ImageLoader("gallery/"+categoryName+"/pictures/" + i + ".jpg", {container:containerMC, x:650, y:0})); imgContainer = new MovieClip(); progressBar = new MyProgressBar(); // Add the preloader to the future image container, then to the array progressBar.name = "progressBar" + i.toString(); imgContainer.addChild(progressBar); imgContainer.name = "imgContainer" + i.toString(); clipArray.push(imgContainer); } queue.load(); function imageProgressHandler(event:LoaderEvent):void { /////// give each loader its own Preloader /////// ////// How to find which loaders are loading to call their respective preloaders? <<--------------------- ////// And set Priority to that loader when button clicked? clipArray(/* select Loader */).progressBar.scaleX = event.target.progress; } function handleClick(event:MouseEvent):void { // Set loading priority to clip } function imageCompleteHandler(event:LoaderEvent):void { /// add loader to container, remove the preloader /// remove the loader /// etc... } /// Other functions for loaderMax listeners Thanks for your time
- 5 replies
-
- preloader
- multiple images
-
(and 1 more)
Tagged with: