Jump to content
Search Community

nitinmukesh

Members
  • Posts

    1
  • Joined

  • Last visited

nitinmukesh's Achievements

0

Reputation

  1. Hi, I was going through the demo code. package demos { import com.greensock.*; import com.greensock.easing.*; import com.greensock.events.LoaderEvent; import com.greensock.loading.*; import flash.display.MovieClip; public class LoaderMax_subload_child extends MovieClip { private var _queue:LoaderMax; public function LoaderMax_subload_child():void { //create an array of image file names var urls:Array = ["agencynet.jpg", "buick.jpg", "cocacola.jpg", "cu3er.jpg", "diva.jpg", "dow.jpg", "waterlife.jpg", "happyplanetshots.jpg", "holdencruze.jpg", "ironman.jpg", "mercedes.jpg", "micromaniac.jpg", "overtheatlantic.jpg", "saab.jpg", "silverpistol.jpg", "soft-se.jpg", "target.jpg", "tonydorio.jpg", "prius.jpg"]; //create the LoaderMax queue into which we'll put the ImageLoaders _queue = new LoaderMax({name:"childQueue", requireWithRoot:this.root, maxConnections:1, onChildComplete:_childCompleteHandler}); //loop through the file names, create an ImageLoader and place it on the stage using special properties like x, y, width, height, etc. The images will also be scaled to fit within the width/height defined. for (var i:int = 0; i < urls.length; i++) { _queue.append( new ImageLoader(urls[i], {container:this, x:(i % 5) * 100, y:int(i / 5) * 64, width:100, height:64, bgColor:0xCCCCCC}) ); } //append a VideoLoader that will continuously loop _queue.append( new VideoLoader("video.flv", {container:this, autoPlay:true, repeat:-1, x:400, y:192, width:100, height:64, bgColor:0xCCCCCC}) ); //prepend all of the urls in the LoaderMax instance with "assets/mid_size" _queue.prependURLs("assets/mid_size/"); //start loading _queue.load(); } //---- EVENT HANDLERS ---------------------------------------------------------------- private function _childCompleteHandler(event:LoaderEvent):void { trace("loaded " + event.target); } } } Is it possible to display the images one by one after the loading is complete (_childCompleteHandler) and determine the width/height before adding the element to stage?
×
×
  • Create New...