Package | com.ghostwire.ui.managers |
Class | public class uiSkins |
Inheritance | uiSkins ![]() |
uiSkins
manager handles requests for skin assets and manages the loading and
caching of external bitmap images used for skinning.
You do not normally need to access this class in your applications; it is used only in component implementations.
uiSkins
cannot be instantiated via the new
operator. To access the singleton
instance, use uiSkins.manager
.
~ This class is available in Aspire UI Components Lite Edition ~
Property | Defined by | ||
---|---|---|---|
manager : uiSkins
[static][read-only]
Indicates the shared instance of the
uiSkins singleton class. | uiSkins | ||
path : String [read-only]
Indicates the path to the folder containing the bitmap skin assets.
| uiSkins |
Method | Defined by | ||
---|---|---|---|
getPrefs(assetName:String):Object
Returns an object containing the
padding , margin ,
focusPadding (and various other properties) that the component using the
skin should be set to. | uiSkins | ||
initialize(theme:String = null, path:String = null, rules:Object = null, smoothing:Boolean = false):void
[static]
Initializes the
uiSkins.manager instance by setting a specific theme and/or path to
use. | uiSkins | ||
request(assetName:String):uiBitmapImage
Returns a skin asset.
| uiSkins |
Event | Summary | Defined by | ||
---|---|---|---|---|
Dispatched when all skin assets have been loaded and the uiSkins manager is ready for use. | uiSkins | |||
Dispatched when loading of the rules XML file has failed. | uiSkins | |||
Dispatched when data is received as the download of skin assets progresses. | uiSkins |
manager | property |
manager:uiSkins
[read-only]
Indicates the shared instance of the uiSkins
singleton class.
public static function get manager():uiSkins
path | property |
path:String
[read-only]
Indicates the path to the folder containing the bitmap skin assets. This property is read-only
and the default path is "assets/skins/". You can specify a different path only at the beginning
of your application, by using the uiSkins.initialize()
method.
public function get path():String
See also
getPrefs | () | method |
public function getPrefs(assetName:String):Object
Returns an object containing the padding
, margin
,
focusPadding
(and various other properties) that the component using the
skin should be set to.
This method is called internally when the skin
property of a component
is set. You should not need to use this method in your application code.
assetName:String — A String value indicating the name of the skin.
|
Object |
initialize | () | method |
public static function initialize(theme:String = null, path:String = null, rules:Object = null, smoothing:Boolean = false):void
Initializes the uiSkins.manager
instance by setting a specific theme and/or path to
use. You do not normally need to initialize the manager since it is done automatically by the
Aspire UI Framework.
This method is exposed to allow you to specify an alternative theme (instead of using the "default" theme), or to change the location of the bitmap assets (default path is "assets/skins/", relative to the location of your swf).
If you need to call this method (because you need to specify a theme folder other than the
"default", or you need to specify a different path other than "assets/skins/"), you need to do
so at the beginning of your application before any code that use any component in the
Aspire UI Framework (because otherwise uiSkins.manager
will be initialized
automatically by the framework using default values).
theme:String (default = null ) — A String value indicating the theme to use.
|
|
path:String (default = null ) — A String indicating the path to the folder containing the bitmap skin assets. There
should be a trailing slash for this value. It is recommended that you move (or copy) the skin
assets you want to use into the default path, rather than change this value.
|
|
rules:Object (default = null ) — An XML object specifying the rendering rules to use for the various skins
in the theme. You should normally use "rules.xml" in your theme folder to specify the rules and leave
this parameter null . You can also specify this as a String value, in which
case it will indicate the XML file to load in-lieu of "rules.xml".
|
|
smoothing:Boolean (default = false ) — A Boolean value indicating whether the bitmap skins should be smoothed when scaled.
|
request | () | method |
public function request(assetName:String):uiBitmapImage
Returns a skin asset. The uiSkins.manager
will first look inside the bitmap cache for
the skin. If it exists, the method returns a uiBitmapImage
object. If it does not
exist inside the cache, the skin will be queued to be loaded externally and the method returns
null
. Unless you are sure that your component is using a loaded skin, you should
indicate a callback function, which will be called automatically when the external bitmap file
is loaded into the cache.
The method also returns null
if the asset has previously been requested and is
missing from the cache as well as external resource.
assetName:String — A String value indicating the name of the bitmap asset to request.
|
uiBitmapImage |
init | event |
flash.events.Event
Dispatched when all skin assets have been loaded and the uiSkins manager is ready for use.
ioError | event |
flash.events.IOErrorEvent.IO_ERROR
Dispatched when loading of the rules XML file has failed.
progress | event |
flash.events.ProgressEvent.PROGRESS
Dispatched when data is received as the download of skin assets progresses. You can listen to this event and track the download progress.
This event has the following properties:
Property | Value |
---|---|
bubbles | false |
bytesLoaded | The accumulated number of bytes loaded at the time the listener processes the event. |
bytesTotal | The total number of bytes that will ultimately be loaded if the loading process completes successfully. |
cancelable | false ; there is no default behavior to cancel. |
currentTarget | The object that is actively processing the Event object with an event listener. |
target | The network object reporting progress. |