home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Puzzle / Clusterz / Clusterz.swf / scripts / ENGINE / INTERFACE / ANIMATORS / OAnimatorManager.as < prev   
Encoding:
Text File  |  2008-09-12  |  2.4 KB  |  96 lines

  1. package ENGINE.INTERFACE.ANIMATORS
  2. {
  3.    import ENGINE.INTERFACE.OIObject;
  4.    
  5.    public class OAnimatorManager
  6.    {
  7.       
  8.       public static const anActivate:int = 2;
  9.       
  10.       public static const anDeactivate:int = 3;
  11.       
  12.       public static const anShow:int = 0;
  13.       
  14.       public static const iAnimatorsCount:int = 10;
  15.       
  16.       public static const anHide:int = 1;
  17.       
  18.       public static const anPress:int = 8;
  19.       
  20.       public static const anRoolOver:int = 6;
  21.       
  22.       public static const anUnpress:int = 9;
  23.       
  24.       public static const anFocusOut:int = 5;
  25.       
  26.       public static const anRoolOut:int = 7;
  27.       
  28.       public static const anUncheck:int = 10;
  29.       
  30.       public static const anCheck:int = 9;
  31.       
  32.       public static const anFocusIn:int = 4;
  33.       
  34.       public static const iNullAnimators:Array = [null,null,null,null,null,null,null,null,null,null];
  35.        
  36.       
  37.       private var iPlaying:Array;
  38.       
  39.       private var iTarget:OIObject;
  40.       
  41.       public function OAnimatorManager(param1:OIObject)
  42.       {
  43.          super();
  44.          this.iTarget = param1;
  45.          this.iPlaying = new Array();
  46.       }
  47.       
  48.       public function get prAnimation() : Boolean
  49.       {
  50.          return iPlaying.length > 0;
  51.       }
  52.       
  53.       public function AddAnimator(param1:Object) : void
  54.       {
  55.          var _loc2_:* = undefined;
  56.          if(param1 == null)
  57.          {
  58.             return;
  59.          }
  60.          if(this.iPlaying.length > 0)
  61.          {
  62.             this.iPlaying[0].Return();
  63.          }
  64.          _loc2_ = param1.F(param1);
  65.          _loc2_.prTarget = this.iTarget;
  66.          this.iPlaying.push(_loc2_);
  67.       }
  68.       
  69.       public function OnEnterFrame() : void
  70.       {
  71.          if(this.iPlaying.length == 0)
  72.          {
  73.             return;
  74.          }
  75.          switch(this.iPlaying[0].State)
  76.          {
  77.             case OAnimator.stEnd:
  78.                this.iPlaying[0] = null;
  79.                this.iPlaying.splice(0,1);
  80.                break;
  81.             case OAnimator.stPause:
  82.                this.iPlaying[0].State = OAnimator.stStart;
  83.                break;
  84.             case OAnimator.stPlay:
  85.                this.iPlaying[0].Play();
  86.          }
  87.       }
  88.       
  89.       public function Free() : void
  90.       {
  91.          this.iTarget = null;
  92.          this.iPlaying = null;
  93.       }
  94.    }
  95. }
  96.