home *** CD-ROM | disk | FTP | other *** search
- package ENGINE.INTERFACE
- {
- import ENGINE.DISPLAY.OBitmap;
- import flash.geom.Point;
- import flash.geom.Rectangle;
-
- public class OProgress extends OIObject
- {
-
-
- public var iProgressBG:OBitmap;
-
- private var iPBG:OBitmap;
-
- public var iProgress:OBitmap;
-
- private var iValue:Number;
-
- public function OProgress(param1:Array, param2:Array = null)
- {
- super(param1,param2);
- }
-
- public function set prValue(param1:Number) : void
- {
- var _loc2_:int = 0;
- var _loc3_:Rectangle = null;
- var _loc4_:Rectangle = null;
- if(param1 < 0)
- {
- param1 = 0;
- }
- else if(param1 > 100)
- {
- param1 = 100;
- }
- if(this.iValue != param1)
- {
- _loc2_ = Math.round(iProgressBG.prOBM.iBM.width * param1 / 100);
- _loc3_ = new Rectangle(0,0,_loc2_,this.iProgressBG.prOBM.iBM.height);
- _loc4_ = new Rectangle(_loc2_,0,iProgressBG.prOBM.iBM.width - _loc2_,this.iProgressBG.prOBM.iBM.height);
- this.iProgressBG.prOBM.iBM.fillRect(this.iPBG.prOBM.iBM.rect,0);
- this.iProgressBG.prOBM.iBM.copyPixels(this.iProgress.prOBM.iBM,_loc3_,new Point(0,0));
- this.iProgressBG.prOBM.iBM.copyPixels(this.iPBG.prOBM.iBM,_loc4_,new Point(_loc2_,0));
- }
- this.iValue = param1;
- }
-
- override public function Init() : void
- {
- super.Init();
- if(this.iProgressBG)
- {
- this.iPBG = this.iProgressBG.Clone();
- }
- }
-
- override public function Free() : void
- {
- this.iProgressBG = null;
- this.iProgress = null;
- super.Free();
- }
-
- public function get prValue() : Number
- {
- return this.iValue;
- }
- }
- }
-