Package | com.ghostwire.ui.managers |
Class | public class uiCursors |
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: 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 ~
Property | Defined 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 |
Method | Defined by | ||
---|---|---|---|
initialize(stage:Stage):void
[static]
Initializes the manager.
| uiCursors |
cursor | property |
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";
To revert to the default custom cursor, set this property to null
.
To set the default custom cursor, use the defaultCursor
property.
public function get cursor():String
public function set cursor(value:String):void
See also
defaultCursor | property |
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"
.
public function get defaultCursor():String
public function set defaultCursor(value:String):void
See also
filters | property |
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
.
manager | property |
manager:uiCursors
[read-only]
Indicates the shared instance of the uiCursors
singleton class.
public static function get manager():uiCursors
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.
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.
|