home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Puzzle / Clusterz / Clusterz.swf / scripts / ENGINE / INTERFACE / OProgress.as < prev    next >
Encoding:
Text File  |  2008-09-12  |  1.9 KB  |  71 lines

  1. package ENGINE.INTERFACE
  2. {
  3.    import ENGINE.DISPLAY.OBitmap;
  4.    import flash.geom.Point;
  5.    import flash.geom.Rectangle;
  6.    
  7.    public class OProgress extends OIObject
  8.    {
  9.        
  10.       
  11.       public var iProgressBG:OBitmap;
  12.       
  13.       private var iPBG:OBitmap;
  14.       
  15.       public var iProgress:OBitmap;
  16.       
  17.       private var iValue:Number;
  18.       
  19.       public function OProgress(param1:Array, param2:Array = null)
  20.       {
  21.          super(param1,param2);
  22.       }
  23.       
  24.       public function set prValue(param1:Number) : void
  25.       {
  26.          var _loc2_:int = 0;
  27.          var _loc3_:Rectangle = null;
  28.          var _loc4_:Rectangle = null;
  29.          if(param1 < 0)
  30.          {
  31.             param1 = 0;
  32.          }
  33.          else if(param1 > 100)
  34.          {
  35.             param1 = 100;
  36.          }
  37.          if(this.iValue != param1)
  38.          {
  39.             _loc2_ = Math.round(iProgressBG.prOBM.iBM.width * param1 / 100);
  40.             _loc3_ = new Rectangle(0,0,_loc2_,this.iProgressBG.prOBM.iBM.height);
  41.             _loc4_ = new Rectangle(_loc2_,0,iProgressBG.prOBM.iBM.width - _loc2_,this.iProgressBG.prOBM.iBM.height);
  42.             this.iProgressBG.prOBM.iBM.fillRect(this.iPBG.prOBM.iBM.rect,0);
  43.             this.iProgressBG.prOBM.iBM.copyPixels(this.iProgress.prOBM.iBM,_loc3_,new Point(0,0));
  44.             this.iProgressBG.prOBM.iBM.copyPixels(this.iPBG.prOBM.iBM,_loc4_,new Point(_loc2_,0));
  45.          }
  46.          this.iValue = param1;
  47.       }
  48.       
  49.       override public function Init() : void
  50.       {
  51.          super.Init();
  52.          if(this.iProgressBG)
  53.          {
  54.             this.iPBG = this.iProgressBG.Clone();
  55.          }
  56.       }
  57.       
  58.       override public function Free() : void
  59.       {
  60.          this.iProgressBG = null;
  61.          this.iProgress = null;
  62.          super.Free();
  63.       }
  64.       
  65.       public function get prValue() : Number
  66.       {
  67.          return this.iValue;
  68.       }
  69.    }
  70. }
  71.