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