home *** CD-ROM | disk | FTP | other *** search
/ Mobiclic 145 / MOBICLIC145.ISO / pc / DATA / DSS145 / DSS145_07 / DSS145_07.swf / scripts / dss145_07 / BarreProgres.as next >
Text File  |  2012-07-18  |  1KB  |  53 lines

  1. package dss145_07
  2. {
  3.    import flash.display.MovieClip;
  4.    
  5.    public class BarreProgres
  6.    {
  7.        
  8.       
  9.       private var _movie:MovieClip;
  10.       
  11.       public var value:int = 0;
  12.       
  13.       private var unityValue:Number = 1;
  14.       
  15.       private var numberMarks:int = 6;
  16.       
  17.       public function BarreProgres(param1:MovieClip)
  18.       {
  19.          super();
  20.          this._movie = param1;
  21.          this.unityValue = 100 / this.numberMarks;
  22.          this.refresh();
  23.       }
  24.       
  25.       public function refresh(param1:Number = 0) : void
  26.       {
  27.          var _loc2_:MovieClip = null;
  28.          if(param1 >= 100)
  29.          {
  30.             this.value = 6;
  31.          }
  32.          else
  33.          {
  34.             this.value = Math.floor(param1 / this.unityValue);
  35.          }
  36.          var _loc3_:int = 1;
  37.          while(_loc3_ <= this.numberMarks)
  38.          {
  39.             _loc2_ = this._movie.getChildByName("TETE_0" + _loc3_) as MovieClip;
  40.             if(_loc3_ > this.value)
  41.             {
  42.                _loc2_.gotoAndStop("E0");
  43.             }
  44.             else
  45.             {
  46.                _loc2_.gotoAndStop("E1");
  47.             }
  48.             _loc3_++;
  49.          }
  50.       }
  51.    }
  52. }
  53.