home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Puzzle / Clusterz / Clusterz.swf / scripts / RES / OBJECTS / OCursor.as < prev    next >
Encoding:
Text File  |  2008-09-12  |  1.7 KB  |  74 lines

  1. package RES.OBJECTS
  2. {
  3.    import ENGINE.DISPLAY.OBitmap;
  4.    import ENGINE.DISPLAY.OSprite;
  5.    import flash.events.Event;
  6.    
  7.    public class OCursor extends OSprite
  8.    {
  9.       
  10.       private static const stAnim2:int = 2;
  11.       
  12.       private static const stNormal:int = 0;
  13.       
  14.       private static const stAnim1:int = 1;
  15.        
  16.       
  17.       private var iState:int;
  18.       
  19.       public function OCursor(param1:OBitmap)
  20.       {
  21.          super();
  22.          this.addChild(param1);
  23.          this.addEventListener(Event.ENTER_FRAME,OnEnterFrame);
  24.          this.State = stNormal;
  25.       }
  26.       
  27.       public function Blink() : void
  28.       {
  29.          this.State = stAnim1;
  30.       }
  31.       
  32.       private function OnEnterFrame(param1:Event) : void
  33.       {
  34.          switch(iState)
  35.          {
  36.             case stAnim1:
  37.                this.scaleX -= 0.05;
  38.                this.scaleY -= 0.05;
  39.                if(this.scaleX < 0.7)
  40.                {
  41.                   State = stAnim2;
  42.                }
  43.                break;
  44.             case stAnim2:
  45.                this.scaleX += 0.05;
  46.                this.scaleY += 0.05;
  47.                if(this.scaleX > 1)
  48.                {
  49.                   State = stNormal;
  50.                }
  51.          }
  52.       }
  53.       
  54.       private function set State(param1:int) : void
  55.       {
  56.          this.iState = param1;
  57.          switch(iState)
  58.          {
  59.             case stNormal:
  60.                this.scaleX = 1;
  61.                this.scaleY = 1;
  62.                break;
  63.             case stAnim1:
  64.                this.scaleX = 1;
  65.                this.scaleY = 1;
  66.                break;
  67.             case stAnim2:
  68.                this.scaleX = 0.7;
  69.                this.scaleY = 0.7;
  70.          }
  71.       }
  72.    }
  73. }
  74.