home *** CD-ROM | disk | FTP | other *** search
/ Computer Active 2010 August / CA08.iso / Multimedija / shufflr.air / ShufflrClient.swf / scripts / qs / controls / LayoutTarget.as < prev   
Encoding:
Text File  |  2010-06-23  |  2.3 KB  |  77 lines

  1. package qs.controls
  2. {
  3.    import flash.display.DisplayObject;
  4.    import flash.geom.Matrix;
  5.    import mx.core.IFlexDisplayObject;
  6.    
  7.    public class LayoutTarget
  8.    {
  9.       private var _capturedValues:LayoutTarget;
  10.       
  11.       public var scaleX:Number = 1;
  12.       
  13.       public var scaleY:Number = 1;
  14.       
  15.       public var state:String = "added";
  16.       
  17.       public var unscaledWidth:Number = 0;
  18.       
  19.       public var initializeFunction:Function;
  20.       
  21.       public var item:IFlexDisplayObject;
  22.       
  23.       public var alpha:Number = 1;
  24.       
  25.       public var animate:Boolean = true;
  26.       
  27.       public var priority:int = 0;
  28.       
  29.       public var x:Number = 0;
  30.       
  31.       public var y:Number = 0;
  32.       
  33.       public var unscaledHeight:Number = 0;
  34.       
  35.       public var releaseFunction:Function;
  36.       
  37.       public function LayoutTarget(param1:IFlexDisplayObject)
  38.       {
  39.          super();
  40.          this.item = param1;
  41.       }
  42.       
  43.       public function release() : void
  44.       {
  45.          this.unscaledHeight = this.item.height;
  46.          this.unscaledWidth = this.item.width;
  47.          this.x = this.item.x;
  48.          this.y = this.item.y;
  49.          var _loc1_:Matrix = DisplayObject(this.item).transform.matrix;
  50.          this.scaleX = _loc1_.a;
  51.          this.scaleY = _loc1_.d;
  52.          this.item.setActualSize(this._capturedValues.unscaledWidth,this._capturedValues.unscaledHeight);
  53.          this.item.move(this._capturedValues.x,this._capturedValues.y);
  54.          _loc1_ = DisplayObject(this.item).transform.matrix;
  55.          _loc1_.a = this._capturedValues.scaleX;
  56.          _loc1_.d = this._capturedValues.scaleY;
  57.          DisplayObject(this.item).transform.matrix = _loc1_;
  58.       }
  59.       
  60.       public function capture() : void
  61.       {
  62.          if(this._capturedValues == null)
  63.          {
  64.             this._capturedValues = new LayoutTarget(this.item);
  65.          }
  66.          this._capturedValues.unscaledHeight = this.item.height;
  67.          this._capturedValues.unscaledWidth = this.item.width;
  68.          this._capturedValues.x = this.item.x;
  69.          this._capturedValues.y = this.item.y;
  70.          var _loc1_:Matrix = DisplayObject(this.item).transform.matrix;
  71.          this._capturedValues.scaleX = _loc1_.a;
  72.          this._capturedValues.scaleY = _loc1_.d;
  73.       }
  74.    }
  75. }
  76.  
  77.