home *** CD-ROM | disk | FTP | other *** search
- package ENGINE.INTERFACE.ANIMATORS
- {
- import ENGINE.INTERFACE.OIObject;
-
- public class OA_Scale extends OAnimator
- {
-
-
- public var iSScale:Number;
-
- private var iEndScale:Number;
-
- public var iEScale:Number;
-
- private var iDScale:Number;
-
- public var iPIter:int;
-
- public function OA_Scale(param1:Object, param2:OIObject = null)
- {
- super(param1,param2);
- }
-
- public static function Make(param1:Object, param2:OIObject = null) : OA_Scale
- {
- return new OA_Scale(param1,param2);
- }
-
- override protected function Start() : int
- {
- var _loc1_:Number = NaN;
- var _loc2_:Number = NaN;
- var _loc3_:Number = NaN;
- _loc1_ = this.iSScale >= 0 ? this.iSScale : Number(this.iTarget.scaleX);
- this.iEndScale = this.iEScale >= 0 ? this.iEScale : Number(this.iTarget.scaleX);
- this.iDScale = (this.iEndScale - _loc1_) / iPIter;
- _loc2_ = Number(this.iTarget.prWidth);
- _loc3_ = Number(this.iTarget.prHeight);
- this.iTarget.scaleX = _loc1_;
- this.iTarget.scaleY = _loc1_;
- this.iTarget.Move((_loc2_ - this.iTarget.prWidth) / 2,(_loc3_ - this.iTarget.prHeight) / 2);
- return Math.abs(this.iDScale) > 0.00001 ? stPlay : stEnd;
- }
-
- override public function Play() : void
- {
- var _loc1_:Number = NaN;
- var _loc2_:Number = NaN;
- var _loc3_:Number = NaN;
- _loc1_ = Number(this.iTarget.prWidth);
- _loc2_ = Number(this.iTarget.prHeight);
- _loc3_ = this.iTarget.scaleX + this.iDScale;
- if(this.iDScale > 0 && _loc3_ >= this.iEndScale || this.iDScale <= 0 && _loc3_ <= this.iEndScale)
- {
- this.iTarget.scaleX = this.iEndScale;
- this.iTarget.scaleY = this.iEndScale;
- this.State = OAnimator.stEnd;
- }
- else
- {
- this.iTarget.scaleX += this.iDScale;
- this.iTarget.scaleY += this.iDScale;
- }
- this.iTarget.Move((_loc1_ - this.iTarget.prWidth) / 2,(_loc2_ - this.iTarget.prHeight) / 2);
- }
- }
- }
-