Commonly used UIComponent properties

The following table lists only the most commonly used properties of components that extend the UIComponent class:

Property

Type

Description

doubleClickEnabled

Boolean

Setting to true lets the component dispatch a doubleClickEvent when a user presses and releases the mouse button twice in rapid succession over the component.

enabled

Boolean

Setting to true lets the component accept keyboard focus and mouse input. The default value is true.

If you set enabled to false for a container, Flex dims the color of the container and all of its children, and blocks user input to the container and to all its children.

height

Number

The height of the component, in pixels.

In MXML tags, but not in ActionScript, you can set this property as a percentage of available space by specifying a value such as 70%; in ActionScript, you must use the percentHeight property.

The property always returns a number of pixels. In ActionScript, you use the perCent

id

String

Specifies the component identifier. This value identifies the specific instance of the object and should not contain any white space or special characters. Each component in a Flex document must have a unique id value. For example, if you have two custom components, each component can include one, and only one Button control with the id "okButton".

percentHeight

Number

The height of the component as a percentage of its parent container, or for <mx:Application> tags, the full height of the browser. Returns NaN if a percent-based width has never been set or if a width property was set after the percentWidth was set.

percentWidth

Number

The width of the component as a percentage of its parent container, or for <mx:Application> tags, the full span of the browser. Returns NaN if a percent-based width has never been set or if a width property was set after the percentWidth was set.

styleName

String

Specifies the style class selector to apply to the component.

toolTip

String

Specifies the text string displayed when the mouse pointer hovers over that component.

visible

Boolean

Specifies whether the container is visible or invisible. The default value is true, which specifies that the container is visible.

width

Number

The width of the component, in pixels.

In MXML tags, but not in ActionScript, you can set this property as a percentage of available space by specifying a value such as 70%; in ActionScript, you must use the percentWidth property.

The property always returns a number of pixels.

x

Number

The component's x position within its parent container. Setting this property directly has an effect only if the parent container uses absolute positioning.

y

Number

The component's y position within its parent container. Setting this property directly has an effect only if the parent container uses absolute positioning.


Flex 2.01

Take a survey