home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Acao / kung_fu.swf / scripts / __Packages / com / KidFighting / EffectSys.as < prev    next >
Encoding:
Text File  |  2006-06-13  |  2.9 KB  |  87 lines

  1. class com.KidFighting.EffectSys extends MovieClip
  2. {
  3.    static var _es;
  4.    static var addEventListener;
  5.    static var dispatchEvent;
  6.    static var removeEventListener;
  7.    static var _evt = mx.events.EventDispatcher.initialize(com.KidFighting.EffectSys);
  8.    function EffectSys()
  9.    {
  10.       super();
  11.       com.KidFighting.EffectSys._es = this;
  12.       com.KidFighting.effects.EffHurt;
  13.       com.KidFighting.effects.EffBlock;
  14.       com.KidFighting.effects.EffSlice;
  15.       com.KidFighting.effects.EffYell;
  16.       com.KidFighting.effects.EffWave;
  17.       com.KidFighting.effects.EffAxe;
  18.       com.KidFighting.effects.EffDynamite;
  19.       com.KidFighting.effects.EffExplosion;
  20.       com.KidFighting.effects.EffScissors;
  21.       com.KidFighting.effects.EffBottle;
  22.       com.KidFighting.effects.EffKnife;
  23.       com.KidFighting.effects.EffBlade;
  24.       com.KidFighting.effects.EffBuddhistPalm;
  25.       com.KidFighting.effects.EffIcecream;
  26.       com.KidFighting.effects.EffIcecreamSplash;
  27.       com.KidFighting.effects.EffBottleSplash;
  28.    }
  29.    static function generate(clsName, twn, ch, x, y)
  30.    {
  31.       var _loc1_ = undefined;
  32.       var _loc3_ = undefined;
  33.       if(clsName == undefined)
  34.       {
  35.          clsName = "Hurt";
  36.       }
  37.       if(typeof clsName == "string")
  38.       {
  39.          _loc3_ = com.KidFighting.EffectSys._es.attachMovie("eff" + clsName + "_mc","eff" + com.KidFighting.EffectSys._es.getNextHighestDepth(),com.KidFighting.EffectSys._es.getNextHighestDepth());
  40.       }
  41.       _loc1_ = new com.KidFighting.effects["Eff" + clsName](_loc3_,twn,ch,x,y);
  42.       if(_loc1_ == null)
  43.       {
  44.          _loc3_.removeMovieClip();
  45.       }
  46.       else
  47.       {
  48.          com.KidFighting.EffectSys.registerEffect(_loc1_);
  49.       }
  50.       return _loc1_;
  51.    }
  52.    static function registerEffect(eff)
  53.    {
  54.       com.KidFighting.EffectSys.addEventListener("onPauseGame",eff);
  55.       com.KidFighting.EffectSys.addEventListener("onResumeGame",eff);
  56.       eff.addEffectListener(com.KidFighting.EffectSys);
  57.    }
  58.    static function pauseGame(evtObj)
  59.    {
  60.       if(evtObj.value)
  61.       {
  62.          com.KidFighting.EffectSys.dispatchEvent({type:"onPauseGame"});
  63.       }
  64.       else
  65.       {
  66.          com.KidFighting.EffectSys.dispatchEvent({type:"onResumeGame"});
  67.       }
  68.    }
  69.    static function onMotionStopped(twn)
  70.    {
  71.       twn.owner.removeEffectListener(com.KidFighting.EffectSys);
  72.       com.KidFighting.EffectSys.removeEventListener("onPauseGame",twn.owner);
  73.       com.KidFighting.EffectSys.removeEventListener("onResumeGame",twn.owner);
  74.    }
  75.    static function getOpponentFlyEffItem(aEffMc)
  76.    {
  77.       for(var _loc2_ in com.KidFighting.EffectSys._es)
  78.       {
  79.          if(com.KidFighting.EffectSys._es[_loc2_].type == "flyItem" && com.KidFighting.EffectSys._es[_loc2_] != aEffMc)
  80.          {
  81.             return com.KidFighting.EffectSys._es[_loc2_];
  82.          }
  83.       }
  84.       return null;
  85.    }
  86. }
  87.