home *** CD-ROM | disk | FTP | other *** search
- package RES.OBJECTS
- {
- import ENGINE.DISPLAY.OBitmap;
- import ENGINE.DISPLAY.OSprite;
- import flash.events.Event;
-
- public class OCursor extends OSprite
- {
-
- private static const stAnim2:int = 2;
-
- private static const stNormal:int = 0;
-
- private static const stAnim1:int = 1;
-
-
- private var iState:int;
-
- public function OCursor(param1:OBitmap)
- {
- super();
- this.addChild(param1);
- this.addEventListener(Event.ENTER_FRAME,OnEnterFrame);
- this.State = stNormal;
- }
-
- public function Blink() : void
- {
- this.State = stAnim1;
- }
-
- private function OnEnterFrame(param1:Event) : void
- {
- switch(iState)
- {
- case stAnim1:
- this.scaleX -= 0.05;
- this.scaleY -= 0.05;
- if(this.scaleX < 0.7)
- {
- State = stAnim2;
- }
- break;
- case stAnim2:
- this.scaleX += 0.05;
- this.scaleY += 0.05;
- if(this.scaleX > 1)
- {
- State = stNormal;
- }
- }
- }
-
- private function set State(param1:int) : void
- {
- this.iState = param1;
- switch(iState)
- {
- case stNormal:
- this.scaleX = 1;
- this.scaleY = 1;
- break;
- case stAnim1:
- this.scaleX = 1;
- this.scaleY = 1;
- break;
- case stAnim2:
- this.scaleX = 0.7;
- this.scaleY = 0.7;
- }
- }
- }
- }
-