home *** CD-ROM | disk | FTP | other *** search
/ Mobiclic 161 / MOBICLIC161.ISO / pc / DATA / DSS161 / DSS161_03 / DSS161_03.swf / scripts / dss161 / ClickZonesSituation.as next >
Text File  |  2014-01-15  |  3KB  |  98 lines

  1. package dss161
  2. {
  3.    import com.milanpresse.tools.GlobalesFunctions;
  4.    import dss161.engineaddons.gamesprotos.Actor;
  5.    import dss161.engineaddons.gamesprotos.actors.actorClip.ActorClip;
  6.    import flash.display.DisplayObject;
  7.    
  8.    public dynamic class ClickZonesSituation extends Actor
  9.    {
  10.        
  11.       
  12.       private var params:Object;
  13.       
  14.       public var btns:Actor;
  15.       
  16.       public function ClickZonesSituation(param1:Object)
  17.       {
  18.          var _loc2_:int = 0;
  19.          var _loc3_:int = 0;
  20.          var _loc4_:DisplayObject = null;
  21.          super(game);
  22.          this.params = param1;
  23.          this.btns = addActor();
  24.          if(param1.clips != undefined)
  25.          {
  26.             _loc2_ = 0;
  27.             while(_loc2_ < param1.clips.length)
  28.             {
  29.                this.targetMCInit(param1.clips[_loc2_]);
  30.                _loc2_++;
  31.             }
  32.          }
  33.          else
  34.          {
  35.             _loc3_ = param1.numeros[0];
  36.             while(_loc3_ <= param1.numeros[1])
  37.             {
  38.                if((_loc4_ = param1.container.getChildByName(param1.pattern.replace("##",GlobalesFunctions.gimme2digits(_loc3_)).replace("#",_loc3_))) != null)
  39.                {
  40.                   this.targetMCInit(_loc4_,_loc3_);
  41.                }
  42.                _loc3_++;
  43.             }
  44.          }
  45.       }
  46.       
  47.       private function targetMCInit(param1:DisplayObject, param2:int = -1) : ActorClip
  48.       {
  49.          var _loc4_:* = null;
  50.          var _loc3_:Object = {};
  51.          for(_loc4_ in this.params.onRollOverState)
  52.          {
  53.             _loc3_[_loc4_] = this.params.onRollOverState[_loc4_];
  54.          }
  55.          if(_loc3_.noiseCode != undefined)
  56.          {
  57.             _loc3_.noiseCode = _loc3_.noiseCode.replace("##",GlobalesFunctions.gimme2digits(param2)).replace("#",param2);
  58.          }
  59.          if(_loc3_.ibId != undefined)
  60.          {
  61.             _loc3_.ibId = _loc3_.ibId.replace("##",GlobalesFunctions.gimme2digits(param2)).replace("#",param2);
  62.          }
  63.          return this.btns.addActor({
  64.             "mc":param1,
  65.             "no":(param2 == -1 ? undefined : param2),
  66.             "onRollOverState":_loc3_,
  67.             "onRollOutState":this.params.onRollOutState,
  68.             "onClickState":this.params.onClickState,
  69.             "onClick":this.params.onClick,
  70.             "onRollOver":this.params.onRollOver,
  71.             "onRollOut":this.params.onRollOut,
  72.             "enabled":true
  73.          });
  74.       }
  75.       
  76.       public function disableAll() : void
  77.       {
  78.          this.btns.foreach(function(param1:ActorClip):void
  79.          {
  80.             param1.enabled = false;
  81.          });
  82.       }
  83.       
  84.       public function enableAll() : void
  85.       {
  86.          this.btns.foreach(function(param1:ActorClip):void
  87.          {
  88.             param1.enabled = true;
  89.          });
  90.       }
  91.       
  92.       override protected function _destroy() : void
  93.       {
  94.          super._destroy();
  95.       }
  96.    }
  97. }
  98.