Packagecom.ghostwire.ui.managers
Classpublic class uiCursors

The uiCursors manager manages the use of custom cursors.

uiCursors cannot be instantiated via the new operator. To access the singleton instance, use uiCursors.manager.

To enable custom cursors in your application, you must call the initialize() method (once) at the beginning of your application:

  uiCursors.initialize(stage);

In addition, assets for the custom cursors must be stored in the correct folder, which is by default "assets/images/cursors/". These assets are typically PNG bitmap images and will be rendered using the com.ghostwire.ui.controls.uiImage class. If you change the path property of the com.ghostwire.ui.controls.uiImage class (from the default "assets/images/"), the path for the cursor assets will change accordingly. Where naming convention is concerned, we will keep custom cursor asset names in upper case, so the assets are stored as "ARROW.png", "BUSY.png", "HELP.png", etc.

The default custom cursor is "ARROW". You can change this value by setting the defaultCursor property. For example, to use "NICE_CURSOR.png" as the default cursor, you would do:

  uiCursors.initialize(stage);
  uiCursors.manager.defaultCursor("NICE_CURSOR");
NOTE: Do not include the file extension when specifying the asset.

NOTE: custom cursors will not work with mouse interactive text fields, which includes editable (input) text fields; when the mouse hovers over such objects, the native Flash Player I-beam cursor will be used.

~ This class is available in Aspire UI Components Standard Edition ~



Public Properties
 PropertyDefined by
  cursor : String
Indicates the current active custom cursor.
uiCursors
  defaultCursor : String
Indicates the default custom cursor.
uiCursors
  filters : Array
Indicates the filters that should be applied to the custom cursor.
uiCursors
  manager : uiCursors
[static][read-only] Indicates the shared instance of the uiCursors singleton class.
uiCursors
Public Methods
 MethodDefined by
  
initialize(stage:Stage):void
[static] Initializes the manager.
uiCursors
Property detail
cursorproperty
cursor:String  [read-write]

Indicates the current active custom cursor. For example, to use "BUSY.png" as the current cursor, you would do:

   uiCursors.manager.cursor = "BUSY";
NOTE: Do not include the file extension when identifying the asset.

To revert to the default custom cursor, set this property to null.

To set the default custom cursor, use the defaultCursor property.

Implementation
    public function get cursor():String
    public function set cursor(value:String):void

See also

defaultCursorproperty 
defaultCursor:String  [read-write]

Indicates the default custom cursor. This is the cursor that will be used if the current active cursor, indicated by the cursor property, is set to null.

Setting this property will also set the cursor property to the same value.

If you want the cursor to be set only temporarily, eg. on mouse over a certain object, you should set the cursor property instead.

The default value is "ARROW".

Implementation
    public function get defaultCursor():String
    public function set defaultCursor(value:String):void

See also

filtersproperty 
public var filters:Array

Indicates the filters that should be applied to the custom cursor. By default, a drop shadow is applied to the cursor. To remove this effect, set this property to null.

managerproperty 
manager:uiCursors  [read-only]

Indicates the shared instance of the uiCursors singleton class.

Implementation
    public static function get manager():uiCursors
Method detail
initialize()method
public static function initialize(stage:Stage):void

Initializes the manager. Your application code must call this once, otherwise the setCursor method will not work.

Parameters
stage:Stage — A reference to the document Stage. Each Flash application has only one Stage object - the stage property of every display object on the display list refers to the same Stage object.