Adobe® Flex® 4 Language Reference
Hide Packages and Classes List |  Packages  |  Classes  |  Index  |  Appendixes
mx.skins 
ProgrammaticSkin 
Public Properties
 PropertyDefined By
 InheritedaccessibilityProperties : AccessibilityProperties
The current accessibility options for this display object.
DisplayObject
 Inheritedalpha : Number
Indicates the alpha transparency value of the object specified.
DisplayObject
 InheritedblendMode : String
A value from the BlendMode class that specifies which blend mode to use.
DisplayObject
 InheritedblendShader : Shader
[write-only] Sets a shader that is used for blending the foreground and background.
DisplayObject
 InheritedcacheAsBitmap : Boolean
If set to true, Flash Player or Adobe AIR caches an internal bitmap representation of the display object.
DisplayObject
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
 Inheritedfilters : Array
An indexed array that contains each filter object currently associated with the display object.
DisplayObject
 Inheritedgraphics : Graphics
[read-only] Specifies the Graphics object belonging to this Shape object, where vector drawing commands can occur.
Shape
 Inheritedheight : Number
Indicates the height of the display object, in pixels.
DisplayObject
  initialized : Boolean
A flag that determines if an object has been through all three phases of layout: commitment, measurement, and layout (provided that any were required).
ProgrammaticSkin
 InheritedloaderInfo : LoaderInfo
[read-only] Returns a LoaderInfo object containing information about loading the file to which this display object belongs.
DisplayObject
 Inheritedmask : DisplayObject
The calling display object is masked by the specified mask object.
DisplayObject
  measuredHeight : Number
[read-only] The measured height of this object.
ProgrammaticSkin
  measuredWidth : Number
[read-only] The measured width of this object.
ProgrammaticSkin
 InheritedmouseX : Number
[read-only] Indicates the x coordinate of the mouse position, in pixels.
DisplayObject
 InheritedmouseY : Number
[read-only] Indicates the y coordinate of the mouse position, in pixels.
DisplayObject
 Inheritedname : String
Indicates the instance name of the DisplayObject.
DisplayObject
  nestLevel : int
Depth of this object in the containment hierarchy.
ProgrammaticSkin
 InheritedopaqueBackground : Object
Specifies whether the display object is opaque with a certain background color.
DisplayObject
 Inheritedparent : DisplayObjectContainer
[read-only] Indicates the DisplayObjectContainer object that contains this display object.
DisplayObject
  processedDescriptors : Boolean
Set to true after immediate or deferred child creation, depending on which one happens.
ProgrammaticSkin
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
 Inheritedroot : DisplayObject
[read-only] For a display object in a loaded SWF file, the root property is the top-most display object in the portion of the display list's tree structure represented by that SWF file.
DisplayObject
 Inheritedrotation : Number
Indicates the rotation of the DisplayObject instance, in degrees, from its original orientation.
DisplayObject
 InheritedrotationX : Number
Indicates the x-axis rotation of the DisplayObject instance, in degrees, from its original orientation relative to the 3D parent container.
DisplayObject
 InheritedrotationY : Number
Indicates the y-axis rotation of the DisplayObject instance, in degrees, from its original orientation relative to the 3D parent container.
DisplayObject
 InheritedrotationZ : Number
Indicates the z-axis rotation of the DisplayObject instance, in degrees, from its original orientation relative to the 3D parent container.
DisplayObject
 Inheritedscale9Grid : Rectangle
The current scaling grid that is in effect.
DisplayObject
 InheritedscaleX : Number
Indicates the horizontal scale (percentage) of the object as applied from the registration point.
DisplayObject
 InheritedscaleY : Number
Indicates the vertical scale (percentage) of an object as applied from the registration point of the object.
DisplayObject
 InheritedscaleZ : Number
Indicates the depth scale (percentage) of an object as applied from the registration point of the object.
DisplayObject
 InheritedscrollRect : Rectangle
The scroll rectangle bounds of the display object.
DisplayObject
 Inheritedstage : Stage
[read-only] The Stage of the display object.
DisplayObject
  styleName : Object
A parent component used to obtain style values.
ProgrammaticSkin
 Inheritedtransform : flash.geom:Transform
An object with properties pertaining to a display object's matrix, color transform, and pixel bounds.
DisplayObject
  updateCompletePendingFlag : Boolean
A flag that determines if an object has been through all three phases of layout validation (provided that any were required).
ProgrammaticSkin
 Inheritedvisible : Boolean
Whether or not the display object is visible.
DisplayObject
 Inheritedwidth : Number
Indicates the width of the display object, in pixels.
DisplayObject
 Inheritedx : Number
Indicates the x coordinate of the DisplayObject instance relative to the local coordinates of the parent DisplayObjectContainer.
DisplayObject
 Inheritedy : Number
Indicates the y coordinate of the DisplayObject instance relative to the local coordinates of the parent DisplayObjectContainer.
DisplayObject
 Inheritedz : Number
Indicates the z coordinate position along the z-axis of the DisplayObject instance relative to the 3D parent container.
DisplayObject
Public Methods
 MethodDefined By
  
Constructor.
ProgrammaticSkin
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event.
EventDispatcher
 Inherited
Dispatches an event into the event flow.
EventDispatcher
 Inherited
getBounds(targetCoordinateSpace:DisplayObject):Rectangle
Returns a rectangle that defines the area of the display object relative to the coordinate system of the targetCoordinateSpace object.
DisplayObject
 Inherited
getRect(targetCoordinateSpace:DisplayObject):Rectangle
Returns a rectangle that defines the boundary of the display object, based on the coordinate system defined by the targetCoordinateSpace parameter, excluding any strokes on shapes.
DisplayObject
  
getStyle(styleProp:String):*
Returns the value of the specified style property.
ProgrammaticSkin
 Inherited
Converts the point object from the Stage (global) coordinates to the display object's (local) coordinates.
DisplayObject
 Inherited
Converts a two-dimensional point from the Stage (global) coordinates to a three-dimensional display object's (local) coordinates.
DisplayObject
 Inherited
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
EventDispatcher
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Evaluates the bounding box of the display object to see if it overlaps or intersects with the bounding box of the obj display object.
DisplayObject
 Inherited
hitTestPoint(x:Number, y:Number, shapeFlag:Boolean = false):Boolean
Evaluates the display object to see if it overlaps or intersects with the point specified by the x and y parameters.
DisplayObject
  
Marks a component so that its updateDisplayList() method gets called during a later screen update.
ProgrammaticSkin
  
Calling this method results in a call to the component's validateProperties() method before the display list is rendered.
ProgrammaticSkin
  
Calling this method results in a call to the component's validateSize() method before the display list is rendered.
ProgrammaticSkin
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Converts a three-dimensional point of the three-dimensional display object's (local) coordinates to a two-dimensional point in the Stage (global) coordinates.
DisplayObject
 Inherited
Converts the point object from the display object's (local) coordinates to the Stage (global) coordinates.
DisplayObject
  
Moves this object to the specified x and y coordinates.
ProgrammaticSkin
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object.
EventDispatcher
  
setActualSize(newWidth:Number, newHeight:Number):void
Sets the height and width of this object.
ProgrammaticSkin
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
  
Whenever any style changes, redraw this skin.
ProgrammaticSkin
 Inherited
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
[override] Returns a string indicating the location of this object within the hierarchy of DisplayObjects in the Application.
FlexShape
  
This function is called by the LayoutManager when it's time for this control to draw itself.
ProgrammaticSkin
  
Validate and update the properties and layout of this object and redraw it, if necessary.
ProgrammaticSkin
  
This function is an empty stub so that ProgrammaticSkin can implement the ILayoutManagerClient interface.
ProgrammaticSkin
  
validateSize(recursive:Boolean = false):void
This function is an empty stub so that ProgrammaticSkin can implement the ILayoutManagerClient interface.
ProgrammaticSkin
 Inherited
Returns the primitive value of the specified object.
Object
 Inherited
Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type.
EventDispatcher
Protected Methods
 MethodDefined By
  
drawRoundRect(x:Number, y:Number, width:Number, height:Number, cornerRadius:Object = null, color:Object = null, alpha:Object = null, gradientMatrix:Matrix = null, gradientType:String = "linear", gradientRatios:Array = null, hole:Object = null):void
Programatically draws a rectangle into this skin's Graphics object.
ProgrammaticSkin
  
Utility function to create a horizontal gradient matrix.
ProgrammaticSkin
  
Utility function to create a rotated gradient matrix.
ProgrammaticSkin
  
updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
Programmatically draws the graphics for this skin.
ProgrammaticSkin
  
Utility function to create a vertical gradient matrix.
ProgrammaticSkin
Events
 Event Summary Defined By
 Inherited[broadcast event] Dispatched when the Flash Player or AIR application gains operating system focus and becomes active.EventDispatcher
 InheritedDispatched when a display object is added to the display list.DisplayObject
 InheritedDispatched when a display object is added to the on stage display list, either directly or through the addition of a sub tree in which the display object is contained.DisplayObject
 Inherited[broadcast event] Dispatched when the Flash Player or AIR application operating loses system focus and is becoming inactive.EventDispatcher
 Inherited[broadcast event] Dispatched when the playhead is entering a new frame.DisplayObject
 Inherited[broadcast event] Dispatched when the playhead is exiting the current frame.DisplayObject
 Inherited[broadcast event] Dispatched after the constructors of frame display objects have run but before frame scripts have run.DisplayObject
 InheritedDispatched when a display object is about to be removed from the display list.DisplayObject
 InheritedDispatched when a display object is about to be removed from the display list, either directly or through the removal of a sub tree in which the display object is contained.DisplayObject
 Inherited[broadcast event] Dispatched when the display list is about to be updated and rendered.DisplayObject
Property Detail

initialized

property
initialized:Boolean

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

A flag that determines if an object has been through all three phases of layout: commitment, measurement, and layout (provided that any were required).



Implementation
    public function get initialized():Boolean
    public function set initialized(value:Boolean):void

measuredHeight

property 
measuredHeight:Number  [read-only]

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

The measured height of this object. This should be overridden by subclasses to return the preferred height for the skin.



Implementation
    public function get measuredHeight():Number

measuredWidth

property 
measuredWidth:Number  [read-only]

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

The measured width of this object. This should be overridden by subclasses to return the preferred width for the skin.



Implementation
    public function get measuredWidth():Number

nestLevel

property 
nestLevel:int

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

Depth of this object in the containment hierarchy. This number is used by the measurement and layout code. The value is 0 if this component is not on the DisplayList.



Implementation
    public function get nestLevel():int
    public function set nestLevel(value:int):void

processedDescriptors

property 
processedDescriptors:Boolean

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

Set to true after immediate or deferred child creation, depending on which one happens. For a Container object, it is set to true at the end of the createComponentsFromDescriptors() method, meaning after the Container object creates its children from its child descriptors.

For example, if an Accordion container uses deferred instantiation, the processedDescriptors property for the second pane of the Accordion container does not become true until after the user navigates to that pane and the pane creates its children. But, if the Accordion had set the creationPolicy property to "all", the processedDescriptors property for its second pane is set to true during application startup.

For classes that are not containers, which do not have descriptors, it is set to true after the createChildren() method creates any internal component children.



Implementation
    public function get processedDescriptors():Boolean
    public function set processedDescriptors(value:Boolean):void

styleName

property 
styleName:Object

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

A parent component used to obtain style values. This is typically set to the component that created this skin.



Implementation
    public function get styleName():Object
    public function set styleName(value:Object):void

updateCompletePendingFlag

property 
updateCompletePendingFlag:Boolean

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

A flag that determines if an object has been through all three phases of layout validation (provided that any were required).



Implementation
    public function get updateCompletePendingFlag():Boolean
    public function set updateCompletePendingFlag(value:Boolean):void
Constructor Detail

ProgrammaticSkin

()Constructor
public function ProgrammaticSkin()

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

Constructor.

Method Detail

drawRoundRect

()method
protected function drawRoundRect(x:Number, y:Number, width:Number, height:Number, cornerRadius:Object = null, color:Object = null, alpha:Object = null, gradientMatrix:Matrix = null, gradientType:String = "linear", gradientRatios:Array = null, hole:Object = null):void

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

Programatically draws a rectangle into this skin's Graphics object.

The rectangle can have rounded corners. Its edges are stroked with the current line style of the Graphics object. It can have a solid color fill, a gradient fill, or no fill. A solid fill can have an alpha transparency. A gradient fill can be linear or radial. You can specify up to 15 colors and alpha values at specified points along the gradient, and you can specify a rotation angle or transformation matrix for the gradient. Finally, the rectangle can have a rounded rectangular hole carved out of it.

This versatile rectangle-drawing routine is used by many skins. It calls the drawRect() or drawRoundRect() methods (in the flash.display.Graphics class) to draw into this skin's Graphics object.

Parameters

x:Number — Horizontal position of upper-left corner of rectangle within this skin.
 
y:Number — Vertical position of upper-left corner of rectangle within this skin.
 
width:Number — Width of rectangle, in pixels.
 
height:Number — Height of rectangle, in pixels.
 
cornerRadius:Object (default = null) — Corner radius/radii of rectangle. Can be null, a Number, or an Object. If it is null, it specifies that the corners should be square rather than rounded. If it is a Number, it specifies the same radius, in pixels, for all four corners. If it is an Object, it should have properties named tl, tr, bl, and br, whose values are Numbers specifying the radius, in pixels, for the top left, top right, bottom left, and bottom right corners. For example, you can pass a plain Object such as { tl: 5, tr: 5, bl: 0, br: 0 }. The default value is null (square corners).
 
color:Object (default = null) — The RGB color(s) for the fill. Can be null, a uint, or an Array. If it is null, the rectangle not filled. If it is a uint, it specifies an RGB fill color. For example, pass 0xFF0000 to fill with red. If it is an Array, it should contain uints specifying the gradient colors. For example, pass [ 0xFF0000, 0xFFFF00, 0x0000FF ] to fill with a red-to-yellow-to-blue gradient. You can specify up to 15 colors in the gradient. The default value is null (no fill).
 
alpha:Object (default = null) — Alpha value(s) for the fill. Can be null, a Number, or an Array. This argument is ignored if color is null. If color is a uint specifying an RGB fill color, then alpha should be a Number specifying the transparency of the fill, where 0.0 is completely transparent and 1.0 is completely opaque. You can also pass null instead of 1.0 in this case to specify complete opaqueness. If color is an Array specifying gradient colors, then alpha should be an Array of Numbers, of the same length, that specifies the corresponding alpha values for the gradient. In this case, the default value is null (completely opaque).
 
gradientMatrix:Matrix (default = null) — Matrix object used for the gradient fill. The utility methods horizontalGradientMatrix(), verticalGradientMatrix(), and rotatedGradientMatrix() can be used to create the value for this parameter.
 
gradientType:String (default = "linear") — Type of gradient fill. The possible values are GradientType.LINEAR or GradientType.RADIAL. (The GradientType class is in the package flash.display.)
 
gradientRatios:Array (default = null) — (optional default [0,255]) Specifies the distribution of colors. The number of entries must match the number of colors defined in the color parameter. Each value defines the percentage of the width where the color is sampled at 100%. The value 0 represents the left-hand position in the gradient box, and 255 represents the right-hand position in the gradient box.
 
hole:Object (default = null) — (optional) A rounded rectangular hole that should be carved out of the middle of the otherwise solid rounded rectangle { x: #, y: #, w: #, h: #, r: # or { br: #, bl: #, tl: #, tr: # } }

See also

getStyle

()method 
public function getStyle(styleProp:String):*

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

Returns the value of the specified style property.

Parameters

styleProp:String — Name of the style property.

Returns
* — The style value. This can be any type of object that style properties can be, such as int, Number, String, etc.

horizontalGradientMatrix

()method 
protected function horizontalGradientMatrix(x:Number, y:Number, width:Number, height:Number):Matrix

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

Utility function to create a horizontal gradient matrix.

Parameters

x:Number — The left edge of the gradient.
 
y:Number — The top edge of the gradient.
 
width:Number — The width of the gradient.
 
height:Number — The height of the gradient.

Returns
Matrix — The horizontal gradient matrix. This is a temporary object that should only be used for a single subsequent call to the drawRoundRect() method.

invalidateDisplayList

()method 
public function invalidateDisplayList():void

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

Marks a component so that its updateDisplayList() method gets called during a later screen update.

Invalidation is a useful mechanism for eliminating duplicate work by delaying processing of changes to a component until a later screen update. For example, if you want to change the width and height, it would be wasteful to update the component immediately after you change the width and then update again with the new height. It is more efficient to change both properties and then render the component with its new size once.

Invalidation methods rarely get called. In general, setting a property on a component automatically calls the appropriate invalidation method.

invalidateProperties

()method 
public function invalidateProperties():void

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

Calling this method results in a call to the component's validateProperties() method before the display list is rendered.

For components that extend UIComponent, this implies that commitProperties() is called.

invalidateSize

()method 
public function invalidateSize():void

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

Calling this method results in a call to the component's validateSize() method before the display list is rendered.

For components that extend UIComponent, this implies that measure() is called, unless the component has both explicitWidth and explicitHeight set.

move

()method 
public function move(x:Number, y:Number):void

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

Moves this object to the specified x and y coordinates.

Parameters

x:Number — The horizontal position, in pixels.
 
y:Number — The vertical position, in pixels.

rotatedGradientMatrix

()method 
protected function rotatedGradientMatrix(x:Number, y:Number, width:Number, height:Number, rotation:Number):Matrix

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

Utility function to create a rotated gradient matrix.

Parameters

x:Number — The left edge of the gradient.
 
y:Number — The top edge of the gradient.
 
width:Number — The width of the gradient.
 
height:Number — The height of the gradient.
 
rotation:Number — The amount to rotate, in degrees.

Returns
Matrix — The horizontal gradient matrix. This is a temporary object that should only be used for a single subsequent call to the drawRoundRect() method.

setActualSize

()method 
public function setActualSize(newWidth:Number, newHeight:Number):void

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

Sets the height and width of this object.

Parameters

newWidth:Number — The width, in pixels, of this object.
 
newHeight:Number — The height, in pixels, of this object.

styleChanged

()method 
public function styleChanged(styleProp:String):void

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

Whenever any style changes, redraw this skin. Subclasses can override this method and perform a more specific test before calling invalidateDisplayList().

Parameters

styleProp:String — The name of the style property that changed, or null if all styles have changed.

updateDisplayList

()method 
protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

Programmatically draws the graphics for this skin.

Subclasses should override this method and include calls to methods such as graphics.moveTo() and graphics.lineTo().

This occurs before any scaling from sources such as user code or zoom effects. The component is unaware of the scaling that takes place later.

Parameters

unscaledWidth:Number — The width, in pixels, of this object before any scaling.
 
unscaledHeight:Number — The height, in pixels, of this object before any scaling.

See also

validateDisplayList

()method 
public function validateDisplayList():void

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

This function is called by the LayoutManager when it's time for this control to draw itself. The actual drawing happens in the updateDisplayList function, which is called by this function.

validateNow

()method 
public function validateNow():void

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

Validate and update the properties and layout of this object and redraw it, if necessary.

validateProperties

()method 
public function validateProperties():void

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

This function is an empty stub so that ProgrammaticSkin can implement the ILayoutManagerClient interface. Skins do not call LayoutManager.invalidateProperties(), which would normally trigger a call to this method.

validateSize

()method 
public function validateSize(recursive:Boolean = false):void

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

This function is an empty stub so that ProgrammaticSkin can implement the ILayoutManagerClient interface. Skins do not call LayoutManager.invalidateSize(), which would normally trigger a call to this method.

Parameters

recursive:Boolean (default = false) — Determines whether children of this skin are validated.

verticalGradientMatrix

()method 
protected function verticalGradientMatrix(x:Number, y:Number, width:Number, height:Number):Matrix

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

Utility function to create a vertical gradient matrix.

Parameters

x:Number — The left edge of the gradient.
 
y:Number — The top edge of the gradient.
 
width:Number — The width of the gradient.
 
height:Number — The height of the gradient.

Returns
Matrix — The horizontal gradient matrix. This is a temporary object that should only be used for a single subsequent call to the drawRoundRect() method.