UISkin class contains the base skin implementation for all UI component skins.
For an overview of skins and skin assets, including an example of how to create your own custom skins, see Understanding skins.
See also
| Property | Defined By | ||
|---|---|---|---|
![]() | containment : String
Gets or sets a property that determines how a component is contained within a parent container. | UIComponent | |
| edgeMetrics : EdgeMetrics [read-only]
Returns the edgeMetrics of the current state. | UISkin | ||
![]() | size : Number
Gets or sets the size for this component (as a percentage of the
container's size, or in pixels). | UIComponent | |
![]() | sizeMode : String
Gets or sets the size mode for this component. | UIComponent | |
![]() | sizeUnit : String
Gets or sets the unit of measure for the size property. | UIComponent | |
| state : String
Gets or sets the state of the skin. | UISkin | ||
| Method | Defined By | ||
|---|---|---|---|
UISkin()
Creates a new UISkin instance. | UISkin | ||
![]() | destroy():void
Call this method when you want to have your object collected by the garbage collector. | UIComponent | |
![]() | drawNow():void
Calls the draw() method. | UIComponent | |
getLayoutRect():Rectangle
Returns the layout rectangle. | UISkin | ||
![]() | invalidate(property:String = all, invalidateNow:Boolean = false):void
Marks the property as invalid and the draw() method is called on the next frame or the next render, whichever comes first. | UIComponent | |
![]() | setPosition(x:Number, y:Number):void
Sets the x and y position of the component. | UIComponent | |
![]() | setSize(w:Number, h:Number):void
Sets the width and height of the component. | UIComponent | |
| Method | Defined By | ||
|---|---|---|---|
![]() | callLater(method:Function):void
Calls the specified method on the next frame or the next render, which ever happens first. | UIComponent | |
![]() | createInstance(linkage:Object):DisplayObject
Calling this method will attempt to create a DisplayObject instance based on the value of the linkage parameter. | UIComponent | |
![]() | draw():void
Called every time you set the width and height of the component. | UIComponent | |
![]() | isInvalid(property:String, ... properties):Boolean
Checks to see if the property is invalid and returns true if it is. | UIComponent | |
![]() | onAdded():void
Called when the instance is added to the stage. | UIComponent | |
![]() | onRemoved():void
Called when the instance is removed from the stage. | UIComponent | |
![]() | setEnabled(val:Boolean):void
Called when the enabled property changes. | UIComponent | |
setSkinState(state:String, asset:DisplayObject):void
Associates a UI component state with a skin asset. | UISkin | ||
showSkin(skin:DisplayObject):void
Shows the given skin state. | UISkin | ||
![]() | validate(property:String = all):void
Lets the component know that the specified property has been validated. | UIComponent | |
| edgeMetrics | property |
edgeMetrics:EdgeMetrics [read-only] Returns the edgeMetrics of the current state. The object has 4 properties left, top, right, bottom.
public function get edgeMetrics():EdgeMetrics| state | property |
state:StringGets or sets the state of the skin.
public function get state():String public function set state(value:String):void| UISkin | () | Constructor |
public function UISkin()
Creates a new UISkin instance.
| getLayoutRect | () | method |
public function getLayoutRect():RectangleReturns the layout rectangle.
ReturnsRectangle — A Rectangle object representing the layout.
|
| setSkinState | () | method |
protected function setSkinState(state:String, asset:DisplayObject):voidAssociates a UI component state with a skin asset. Use this method to set up custom skins.
Parameters
state:String — The state for which to set the skin asset.
| |
asset:DisplayObject — The asset to associate with the skin.
|
| showSkin | () | method |
protected function showSkin(skin:DisplayObject):voidShows the given skin state.
Use this method to display skin states in custom skins.
Parameters
skin:DisplayObject — The instance of the skin state.
|