home *** CD-ROM | disk | FTP | other *** search
- package ENGINE.INTERFACE.ANIMATORS
- {
- import ENGINE.INTERFACE.OIObject;
- import flash.display.DisplayObject;
-
- public class OA_AlphaInd extends OAnimator
- {
-
-
- public var iEAlpha:Number;
-
- private var iCurAlpha:Number;
-
- private var iEndAlpha:Array;
-
- private var iDAlpha:Array;
-
- public var iInd:Array;
-
- public var iSAlpha:Number;
-
- public var iPIter:int;
-
- public function OA_AlphaInd(param1:Object, param2:OIObject = null)
- {
- super(param1,param2);
- }
-
- public static function Make(param1:Object, param2:OIObject = null) : OA_AlphaInd
- {
- return new OA_AlphaInd(param1,param2);
- }
-
- override protected function Start() : int
- {
- var _loc1_:int = 0;
- var _loc2_:int = 0;
- var _loc3_:DisplayObject = null;
- var _loc4_:Number = NaN;
- if(!this.iInd || this.iInd.length == 0)
- {
- return stEnd;
- }
- _loc1_ = int(this.iInd.length);
- this.iEndAlpha = new Array(_loc1_);
- this.iDAlpha = new Array(_loc1_);
- _loc2_ = 0;
- while(_loc2_ < _loc1_)
- {
- _loc3_ = this.iTarget.getChildAt(this.iInd[_loc2_]);
- _loc4_ = this.iSAlpha >= 0 ? this.iSAlpha : _loc3_.alpha;
- this.iEndAlpha[_loc2_] = this.iEAlpha >= 0 ? this.iEAlpha : _loc3_.alpha;
- this.iDAlpha[_loc2_] = (this.iEndAlpha[_loc2_] - _loc4_) / iPIter;
- _loc3_.visible = true;
- _loc3_.alpha = _loc4_;
- _loc2_++;
- }
- this.iCurAlpha = this.iTarget.getChildAt(this.iInd[0]).alpha;
- return Math.abs(this.iDAlpha[0]) > 0.001 ? stPlay : stEnd;
- }
-
- override public function Play() : void
- {
- var _loc1_:int = 0;
- var _loc2_:int = 0;
- var _loc3_:DisplayObject = null;
- this.iCurAlpha += this.iDAlpha[0];
- _loc1_ = int(this.iInd.length);
- if(this.iDAlpha[0] > 0 && this.iCurAlpha >= this.iEndAlpha[0] || this.iDAlpha[0] <= 0 && this.iCurAlpha <= this.iEndAlpha[0])
- {
- _loc2_ = 0;
- while(_loc2_ < _loc1_)
- {
- _loc3_ = this.iTarget.getChildAt(this.iInd[_loc2_]);
- _loc3_.alpha = this.iEndAlpha[_loc2_];
- _loc3_.visible = _loc3_.alpha > 0;
- _loc2_++;
- }
- this.State = stEnd;
- }
- else
- {
- _loc2_ = 0;
- while(_loc2_ < _loc1_)
- {
- _loc3_ = this.iTarget.getChildAt(this.iInd[_loc2_]);
- _loc3_.alpha += this.iDAlpha[_loc2_];
- _loc2_++;
- }
- }
- }
- }
- }
-