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

  1. package ENGINE.INTERFACE.ANIMATORS
  2. {
  3.    import ENGINE.INTERFACE.OIObject;
  4.    
  5.    public class OAnimator
  6.    {
  7.       
  8.       public static const stStart:int = 1;
  9.       
  10.       public static const stEnd:int = 3;
  11.       
  12.       public static const stPause:int = 0;
  13.       
  14.       public static const stReturn:int = 4;
  15.       
  16.       public static const stPlay:int = 2;
  17.        
  18.       
  19.       private var iState:int;
  20.       
  21.       protected var iTarget:OIObject;
  22.       
  23.       public function OAnimator(param1:Object, param2:OIObject = null)
  24.       {
  25.          var _loc3_:String = null;
  26.          super();
  27.          for(_loc3_ in param1)
  28.          {
  29.             if(this.hasOwnProperty(_loc3_))
  30.             {
  31.                this[_loc3_] = param1[_loc3_];
  32.             }
  33.          }
  34.          this.iTarget = param2;
  35.          this.State = stPause;
  36.       }
  37.       
  38.       public function set State(param1:int) : void
  39.       {
  40.          this.iState = param1;
  41.          switch(this.iState)
  42.          {
  43.             case stStart:
  44.                this.State = this.Start();
  45.                break;
  46.             case stReturn:
  47.                this.State = Return();
  48.          }
  49.       }
  50.       
  51.       public function Play() : void
  52.       {
  53.          this.State = stEnd;
  54.       }
  55.       
  56.       public function set prTarget(param1:OIObject) : void
  57.       {
  58.          this.iTarget = param1;
  59.       }
  60.       
  61.       protected function Start() : int
  62.       {
  63.          return stPlay;
  64.       }
  65.       
  66.       public function get State() : int
  67.       {
  68.          return this.iState;
  69.       }
  70.       
  71.       public function Return() : int
  72.       {
  73.          return stPlay;
  74.       }
  75.       
  76.       public function OnEnterFrame() : void
  77.       {
  78.          if(this.iState == stPlay)
  79.          {
  80.             Play();
  81.          }
  82.       }
  83.    }
  84. }
  85.