Packageorg.aswing
Classpublic class CursorManager

The CursorManager, manage the cursor, hide system mouse cursor, show custom cursor, etc.



Protected Properties
 PropertyDefined by
  currentCursor : DisplayObject = null
CursorManager
  cursorHolder : DisplayObjectContainer = null
CursorManager
  root : DisplayObjectContainer = null
CursorManager
Public Methods
 MethodDefined by
  
CursorManager(cursorRoot:DisplayObjectContainer)
Create a CursorManage
CursorManager
  
getManager(stage:Stage = null):CursorManager
[static] Returns the default cursor manager for specified stage.
CursorManager
  
hideCustomCursor(cursor:DisplayObject):void
Hides the custom cursor which is showing and show the system cursor.
CursorManager
  
setCursor(trigger:InteractiveObject, cursor:DisplayObject):void
Sets the cursor when mouse on the specified trigger.
CursorManager
  
showCustomCursor(cursor:DisplayObject, hideSystemCursor:Boolean = true):void
Shows your display object as the cursor and/or not hide the system cursor.
CursorManager
Protected Methods
 MethodDefined by
  
getCursorContainerRoot():DisplayObjectContainer
CursorManager
  
setCursorContainerRoot(theRoot:DisplayObjectContainer):void
Sets the container to hold the cursors(in fact it will hold the cursor's parent--a sprite).
CursorManager
Property detail
currentCursorproperty
protected var currentCursor:DisplayObject = null
cursorHolderproperty 
protected var cursorHolder:DisplayObjectContainer = null
rootproperty 
protected var root:DisplayObjectContainer = null
Constructor detail
CursorManager()constructor
public function CursorManager(cursorRoot:DisplayObjectContainer)

Create a CursorManage

Parameters
cursorRoot:DisplayObjectContainer — the container to hold the cursors

See also

Method detail
getCursorContainerRoot()method
protected function getCursorContainerRoot():DisplayObjectContainer

Returns
DisplayObjectContainer
getManager()method 
public static function getManager(stage:Stage = null):CursorManager

Returns the default cursor manager for specified stage.

Generally, you should call this method to get cursor manager, it will create one manager for each stage.

Parameters
stage:Stage (default = null) — the stage, if pass null, the inital Stage of AsWingManager.getStage() will be used.

Returns
CursorManager
hideCustomCursor()method 
public function hideCustomCursor(cursor:DisplayObject):void

Hides the custom cursor which is showing and show the system cursor.

Parameters
cursor:DisplayObject — the showing cursor, if it is not the showing cursor, nothing will happen
setCursor()method 
public function setCursor(trigger:InteractiveObject, cursor:DisplayObject):void

Sets the cursor when mouse on the specified trigger. null to remove cursor for that trigger.

Parameters
trigger:InteractiveObject — where the cursor will shown when the mouse on the trigger
 
cursor:DisplayObject — the cursor object, if cursor is null, the trigger's current cursor will be removed
setCursorContainerRoot()method 
protected function setCursorContainerRoot(theRoot:DisplayObjectContainer):void

Sets the container to hold the cursors(in fact it will hold the cursor's parent--a sprite). By default(if you have not set one), it is the stage if AsWingManager is inited.

Parameters
theRoot:DisplayObjectContainer — the container to hold the cursors.
showCustomCursor()method 
public function showCustomCursor(cursor:DisplayObject, hideSystemCursor:Boolean = true):void

Shows your display object as the cursor and/or not hide the system cursor. If current another custom cursor is showing, the current one will be removed and then the new one is shown.

Parameters
cursor:DisplayObject — the display object to be add to the cursor container to be the cursor
 
hideSystemCursor:Boolean (default = true) — whether or not hide the system cursor when custom cursor shows.