public class CustomMousePointer extends Sprite { public function CustomMousePointer ( ) { graphics.lineStyle(1); graphics.beginFill(0x0000FF, 1); graphics.lineTo(15, 5); graphics.lineTo(5, 15); graphics.lineTo(0, 0); graphics.endFill( );
var stageDetector:StageDetector = new StageDetector(this); stageDetector.addEventListener(StageDetector.ADDED_TO_STAGE, addedToStageListener); stageDetector.addEventListener(StageDetector.REMOVED_FROM_STAGE, removedFromStageListener); }
private function addedToStageListener (e:Event):void { Mouse.hide( );
private function mouseLeaveListener (e:Event):void { visible = false; }
private function mouseMoveListener (e:MouseEvent):void { var pointInParent:Point = parent.globalToLocal(new Point(e.stageX, e.stageY)); x = pointInParent.x; y = pointInParent.y;
e.updateAfterEvent( );
if (!visible) { visible = true; } } } }
Related Scripts with Example Source Code in same category :