home *** CD-ROM | disk | FTP | other *** search
- package ENGINE.INTERFACE
- {
- import ENGINE.INTERFACE.ANIMATORS.*;
-
- public class OCounter extends OIObject
- {
-
- public static const iDefAnimators:Array = [{
- "F":OA_Alpha.Make,
- "iSAlpha":0,
- "iEAlpha":1,
- "iPIter":6
- },{
- "F":OA_Alpha.Make,
- "iSAlpha":-1,
- "iEAlpha":0,
- "iPIter":6
- },{
- "F":OA_Alpha.Make,
- "iSAlpha":-1,
- "iEAlpha":1,
- "iPIter":6
- },{
- "F":OA_Alpha.Make,
- "iSAlpha":-1,
- "iEAlpha":0.2,
- "iPIter":6
- },null,null,null,null,null,null];
-
-
- public var iSeparator:OIObject;
-
- public var iDigits0:Array;
-
- public var iDigits:Array;
-
- protected var iValue:int;
-
- protected var iValue0:int;
-
- protected var iWidth:Number;
-
- protected var iHeight:Number;
-
- public function OCounter(param1:Array, param2:Number, param3:Number, param4:Array = null)
- {
- var _loc5_:Array = null;
- this.iWidth = param2;
- this.iHeight = param3;
- _loc5_ = !!param4 ? param4 : iDefAnimators;
- super(param1,_loc5_);
- }
-
- public function set prValue0(param1:int) : void
- {
- this.iValue0 = Math.max(param1,0);
- if(!this.iDigits0)
- {
- return;
- }
- this.iValue0 = Math.min(this.iValue0,Math.pow(10,this.iDigits0.length) - 1);
- Draw();
- }
-
- public function set prValue(param1:int) : void
- {
- this.iValue = Math.max(param1,0);
- if(!this.iDigits)
- {
- return;
- }
- this.iValue = Math.min(this.iValue,Math.pow(10,this.iDigits.length) - 1);
- Draw();
- }
-
- override public function Init() : void
- {
- this.iDigits = new Array();
- this.iDigits0 = new Array();
- super.Init();
- }
-
- private function Draw() : void
- {
- var _loc1_:Number = NaN;
- var _loc2_:String = null;
- var _loc3_:String = null;
- var _loc4_:int = 0;
- var _loc5_:Number = NaN;
- var _loc6_:int = 0;
- _loc1_ = 0;
- _loc2_ = this.iValue0.toString();
- _loc3_ = this.iValue.toString();
- _loc4_ = 0;
- while(_loc4_ < this.iDigits0.length)
- {
- this.iDigits0[_loc4_].prAnimationEnabled = this.iAEnabled;
- _loc4_++;
- }
- _loc4_ = 0;
- while(_loc4_ < this.iDigits.length)
- {
- this.iDigits[_loc4_].prAnimationEnabled = this.iAEnabled;
- _loc4_++;
- }
- if(this.iDigits0.length)
- {
- _loc4_ = _loc2_.length - 1;
- while(_loc4_ >= 0)
- {
- this.iDigits0[_loc4_].prValue = _loc2_.charCodeAt(_loc4_) - 47;
- _loc4_--;
- }
- _loc6_ = this.iDigits0.length - _loc2_.length;
- _loc4_ = 0;
- while(_loc4_ < _loc6_)
- {
- if(this.iDigits0[_loc4_].prValue)
- {
- this.iDigits0[_loc4_].prValue = 0;
- }
- _loc4_++;
- }
- }
- if(this.iDigits.length)
- {
- _loc4_ = 0;
- while(_loc4_ < _loc3_.length)
- {
- this.iDigits[_loc4_].prValue = _loc3_.charCodeAt(_loc4_) - 47;
- _loc4_++;
- }
- _loc6_ = int(this.iDigits.length);
- _loc4_ = _loc3_.length;
- while(_loc4_ < _loc6_)
- {
- if(this.iDigits[_loc4_].prValue)
- {
- this.iDigits[_loc4_].prValue = 0;
- }
- _loc4_++;
- }
- }
- if(this.iDigits0.length)
- {
- _loc4_ = _loc2_.length - 1;
- while(_loc4_ >= 0)
- {
- _loc1_ += this.iDigits0[_loc4_].prWidth;
- _loc4_--;
- }
- }
- if(this.iSeparator)
- {
- _loc1_ += this.iSeparator.prWidth;
- }
- if(this.iDigits.length)
- {
- _loc4_ = 0;
- while(_loc4_ < _loc3_.length)
- {
- _loc1_ += this.iDigits[_loc4_].prWidth;
- _loc4_++;
- }
- }
- _loc5_ = (this.iWidth - _loc1_) / 2;
- if(this.iDigits0.length)
- {
- _loc4_ = 0;
- while(_loc4_ < this.iDigits0.length)
- {
- if(this.iDigits0[_loc4_].prValue)
- {
- this.iDigits0[_loc4_].PosValue(_loc5_,(this.iWidth - this.iDigits0[_loc4_].prHeight) / 2);
- _loc5_ += this.iDigits0[_loc4_].prWidth;
- }
- _loc4_++;
- }
- }
- if(this.iSeparator)
- {
- this.iSeparator.Pos(_loc5_,(this.iHeight - this.iSeparator.prHeight) / 2);
- _loc5_ += this.iSeparator.prWidth;
- }
- if(this.iDigits.length)
- {
- _loc4_ = 0;
- while(_loc4_ < this.iDigits.length)
- {
- if(this.iDigits[_loc4_].prValue)
- {
- this.iDigits[_loc4_].PosValue(_loc5_,(this.iHeight - this.iDigits[_loc4_].prHeight) / 2);
- _loc5_ += this.iDigits[_loc4_].prWidth;
- }
- _loc4_++;
- }
- }
- }
-
- public function get prValue0() : int
- {
- return this.iValue0;
- }
-
- override public function Free() : void
- {
- this.iDigits = null;
- this.iDigits0 = null;
- this.iSeparator = null;
- super.Free();
- }
-
- public function get prValue() : int
- {
- return this.iValue;
- }
- }
- }
-