티스토리 뷰

 

  1. package  {
  2.  import com.greensock.*;
  3.  import com.greensock.easing.*;
  4.  import com.greensock.events.LoaderEvent;
  5.  import com.greensock.loading.display.core.ProgressDisplayLite;
  6.  import com.greensock.loading.*;
  7.  import com.greensock.loading.display.*;
  8.  import flash.display.MovieClip;
  9.  
  10.  public class LoaderMax_Progress extends MovieClip {
  11.    private var _queue:LoaderMax;  
  12.    private var _progressDisplay:ProgressCircleLite;
  13.    private var _progress:ProgressDisplayLite;
  14.    
  15.    public function LoaderMax_Progress():void {  
  16.     var urls:Array = ["imag1.jpg","imag2.jpg","imag3.jpg","imag4.jpg","imag5.jpg","imag6.jpg","imag7.jpg"];
  17.     _queue = new LoaderMax({name:"childQueue", requireWithRoot:this.root, maxConnections:1, onChildComplete:_childCompleteHandler ,onProgress:_progressHandler});
  18.     ies like x, y, width, height, etc. The images will also be scaled to fit within the width/height defined.
  19.     for (var i:int = 0; i < urls.length; i++) {
  20.      _queue.append( new ImageLoader(urls[i], {container:this,
  21.                 x:(i % 5) * 100,
  22.                 y:int(i / 5) * 64,
  23.                 width:100,
  24.                 height:64
  25.      }));
  26.     }  
  27.     _queue.prependURLs("assets/mid_size/");  
  28.     _queue.load();  
  29.    
  30.     _progressDisplay = new ProgressCircleLite( { radius:26, thickness:4, trackColor:0xFFFFFF, trackAlpha:0.25, trackThickness:4, autoTransition:false, smoothProgress:0 } );
  31.     this.addChild(_progressDisplay);
  32.     _progressDisplay.mouseEnabled = false;
  33.     _progressDisplay.x = 70;
  34.     _progressDisplay.y = 300;
  35.     _progressDisplay.addLoader(_queue);
  36.    
  37.     _progress = new ProgressDisplayLite();
  38.     _progress.addLoader(_queue);
  39.    }
  40.    
  41.  //---- EVENT HANDLERS ----------------------------------------------------------------  
  42.    private function _childCompleteHandler(event:LoaderEvent):void {
  43.     //trace("loaded " + event.target);
  44.    }
  45.    private function _progressHandler(event:LoaderEvent):void {
  46.     trace("loaded " + _progress.progress);
  47.    }  
  48.    
  49.   }
  50. }

'ActionScript3.0 > LoaderMax' 카테고리의 다른 글

2. LoaderMax 불러온 swf 메소드 호출  (0) 2011.04.25
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday