Direct Known Subclasses
The UIObject class is the base class for all components and graphical objects. UIObjects support events and styles, and resize by scaling. The UIObject class itself is not used as an MXML tag.
Common MXML Syntax Inherited from UIObject
All user interface components in Flex extend the UIObject class. Flex components inherit the following properties from the UIObject class.
<mx:tagname
color="value"
draw="value"
effectEnd="value"
effectStart="value"
fontFamily="value"
fontSize="value"
fontStyle="value"
fontWeight="value"
height="value"
heightFlex="value"
id="value"
initialize="value"
load="value"
marginLeft="value"
marginRight="value"
maxHeight="value"
maxWidth="value"
minHeight="value"
minWidth="value"
mouseDown="value"
mouseDownEffect="value"
mouseOut="value"
mouseOutEffect="value"
mouseOver="value"
mouseOverEffect="value"
mouseUp="value"
mouseUpEffect="value"
move="value"
moveEffect="value"
nestLevel="value
preferredWidth="value"
preferredHeight="value"
resizeEffect="value"
scaleX="value"
scaleY="value"
styleName="value"
textAlign="value"
textDecoration="value"
textIndent="value"
toolTip="value"
unload="value"
visible="value"
width="value"
widthFlex="value"
x="Only recognized when a component is a child
of a View container."
y="Only recognized when a component is a child
of a View container."
>
...
child tags
...
</mx:UIObject>
See Also
mx.core.UIComponent
| Constructors | |
UIObject
()
Constructor. |
|
| Methods | |
| addEventListener
Adds a listener for a particular event. |
| cancelAllDoLaters() : Void
Cancels all queued functions. |
| createAccessibilityImplementation() : Void
Creates accessibility implementation. |
| createClassObject(classRef:Function, name:String, depth:Number, initObj:Object) : UIObject
Creates a subobject from its class definition. |
| createEmptyObject(name:String, depth:Number) : UIObject
Creates a blank or empty subobject. |
| destroyLabel(name:String) : Void
Destroys a text label created by the createLabel method. |
| destroyObject(name:String) : Void
Destroys the subobject. |
| dispatchEvent
Dispatch the event to all listeners. |
| doLater(obj:Object, fn:String, args:Array) : Void
Queues a function to be called later. |
| drawRect(x1:Number, y1:Number, x2:Number, y2:Number, r) : Void
Draws an unfilled rectangle on the screen. |
| fillRect(x1:Number, y1:Number, x2:Number, y2:Number, rgb:Number, alpha:Number) : Void
Fills the rectangle on the screen. |
| getRepeaterItem
The signature of this method is getRepeaterItem(whichRepeater). |
| getStyle(styleProp:String) : Void
Gets a style property. |
| handleEvent
Handles all events. |
| invalidate() : Void
Marks a component so that it is redrawn on the next frame interval. |
| invalidateProperties() : Void
If a property setter must do a lot of processing, it should wait to do that processing during the next measurement or layout cycle. |
| invalidateSize() : Void
Called if the object`s size is changing. |
| invalidateStyle(styleProp:String) : Void
Called if only styles are changing, so subclasses don`t have to redraw everything. |
| measure() : Void
Determines the size of the component. |
| move(x:Number, y:Number, noEvent:Boolean) : Void
Moves the object. |
| redraw(bAlways:Boolean) : Void
Redraws the object instead of waiting for invalidation to do so. |
| removeEventListener
Remove a listener for a particular event. |
| setMask(mask_mc:MovieClip) : Void
Overrides the MovieClip. |
| setSize(w:Number, h:Number, noEvent:Boolean) : Void
Sizes the object. |
| setSizeNoLayout(w:Number, h:Number, noEvent:Boolean) : Void
Sizes the object. |
| setStyle
Sets a style property. |
| swapDepths(target) : Void
Overrides the MovieClip. |
| Properties | |
static | version:String
ComponentVersion is for internal use only. |
| nestLevel:Number
Depth of this object in the containment hierarchy. |
static | kStretch:Number
Number used to indicate stretchability in the preferredWidth and preferredHeight. |
| styleName:String
CSSStyleDeclaration or pointer to parent to be used by component in calculating style values. |
| className:String
Name of component class. |
| parentApplication:Object
[Read-Only]
A reference to the Application object that contains this UIObject instance. |
| isDocument:Boolean
[Read-Only]
Determines whether this UIObject instance is a document object, that is, whether it is at the top of the hierarchy of a Flex application, MXML component, or ActionScript component. |
| parentDocument:Object
[Read-Only]
A reference to the parent document object for this UIObject. |
| documentDescriptor:Object
[Read-Only]
For a document object, which is an instance of a UIObject at the top of the hierarchy of a Flex application, MXML component, or ActionScript component, the documentDescriptor property is a reference to the descriptor at the top of the autogenerated descriptor tree for that document. |
| descriptor:Object
[Read-Only]
Reference to the UIObjectDescriptor, if any, that was used by the createComponent method to create this UIObject instance. |
| instanceIndices:Array
An Array that contains the indices required to reference a Repeater from its parent document. |
| repeaterIndices:Array
An array that contains the indices of the items in the dataProviders of the Repeaters in the parent document that produced this Repeater. |
| id:String
[Read-Write]
MXML ID of this UIObject INSTANCE. |
| width:Number
[Read-Write]
Number that specifies the width of the component, in pixels. |
| height:Number
[Read-Write]
Number that specifies the height of the component, in pixels. |
| x:Number
[Read-Write]
Number that specifies the component`s x position within its parent container. |
| y:Number
[Read-Write]
Number that specifies the component`s y position within its parent container. |
| minHeight:Number
[Read-Write]
Number that specifies the minimum height of the component, in pixels. |
| minWidth:Number
[Read-Write]
Number that specifies the minimum width of the component, in pixels. |
| preferredHeight:Number
[Read-Write]
Number that specifies the preferred height of the component, in pixels. |
| preferredWidth:Number
[Read-Write]
Number that specifies the preferred width of the component, in pixels. |
| maxHeight:Number
[Read-Write]
Number that specifies the maximum height of the component, in pixels. |
| maxWidth:Number
[Read-Write]
Number that specifies the maximum width of the component, in pixels. |
| widthFlex:Number
[Read-Write]
Setting to a positive number enables resizing of the component width. |
| heightFlex:Number
[Read-Write]
Setting to a positive number enables resizing of the component height. |
| visible:Boolean
[Read-Write]
If true, the object is visible. |
| scaleX:Number
[Read-Write]
Number that specifies the horizontal scaling percentage. |
| scaleY:Number
[Read-Write]
Number that specifies the vertical scaling percentage. |
| alpha:Void
[Write-Only]
Determines how transparent a component is. |
| depth:Number
[Read-Only]
The MovieClip depth of the UIObject instance, which determines the z-ordering. |
| mouseX:Number
[Read-Only]
Horizontal coordinate of the mouse pointer`s location in the coordinate system of this UIObject instance. |
| mouseY:Number
[Read-Only]
Vertical coordinate of the mouse pointer`s location in the coordinate system of this UIObject instance. |
| toolTip:String
Text to display in the ToolTip. |
| baselinePosition:Number
[Read-Only]
Determines the baseline y-coordinate of the first line of text of the component. |
| Effects | |
creationCompleteEffect | Component is created. |
moveEffect | Component is moved. |
resizeEffect | Component is resized. |
mouseDownEffect | User presses the mouse button while over the component. |
mouseOverEffect | User rolls the mouse over the component. |
mouseOutEffect | User rolls the mouse so it is no longer over the component. |
mouseUpEffect | User releases the mouse button. |
| Events | |
initialize | Broadcast when Flex initializes the component. Target contains a reference to the component that triggered the event. Type contains the name of the event. |
creationComplete | Broadcast when the object has finished its construction, measuring, layout, and drawing. Target contains a reference to the component that triggered the event. Type contains the name of the event. |
resize | Broadcast when the component is resized. The event object contains the following properties: - oldWidth Previous width. - oldHeight Previous height. Target contains a reference to the component that triggered the event. Type contains the name of the event. |
move | Broadcast when the object has moved. The event object contains the following properties: - oldX Previous x coordinate. - oldY Previous y coordinate. Target contains a reference to the component that triggered the event. Type contains the name of the event. |
draw | Broadcast when an object is about to draw its graphics. Target contains a reference to the component that triggered the event. Type contains the name of the event. |
load | Broadcast when subobjects are being loaded. Target contains a reference to the component that triggered the event. Type contains the name of the event. |
unload | Broadcast when the subobjects are being unloaded. Target contains a reference to the component that triggered the event. Type contains the name of the event. |
mouseDown | Broadcast when the cursor is over the component and the user clicks the mouse button. Target contains a reference to the component that triggered the event. Type contains the name of the event. |
mouseUp | Broadcast when the cursor is over the component and the user releases the mouse button. Target contains a reference to the component that triggered the event. Type contains the name of the event. |
mouseMove | Broadcast when the user moves the mouse. Target contains a reference to the component that triggered the event. Type contains the name of the event. |
mouseOver | Broadcast when the user moves the cursor over the component. Target contains a reference to the component that triggered the event. Type contains the name of the event. |
mouseOut | Broadcast when the user moves the cursor off of the component. Target contains a reference to the component that triggered the event. Type contains the name of the event. |
mouseDownSomewhere | Broadcast when the user clicks the mouse button, even if it`s outside the MovieClip. |
mouseUpSomewhere | Broadcast when the user releases the mouse button, even if it"s outside the MovieClip. |
mouseMoveSomewhere | Broadcast whenever the user moves the mouse, even if it is still over the same MovieClip. |
mouseChangeSomewhere | Broadcast when the user moves the mouse from one MovieClip to another. |
effectStart | Broadcast when an effect starts. Target contains a reference to the component that triggered the event. Type contains the name of the event. |
effectEnd | Broadcast when an effect ends. Target contains a reference to the component that triggered the event. Type contains the name of the event. |
dragBegin | Broadcast to the drag initiator when the user makes a gesture that starts a dragand- drop operation. No Flex components respond to this event; it is for use by any custom components that you create. Target contains a reference to the component that triggered the event. Type contains the name of the event. |
dragComplete | Broadcast to the drag initiator when the drag operation completes, either when you drop the drag data onto a drop target or when you end the drag-and-drop operation without performing a drop. You can use this event to perform any final cleanup of the dragand- drop operation. For example, if you drag a List control item from one list to another, you can delete the List control item from the source if you no longer need it. Target contains a reference to the component that triggered the event. Type contains the name of the event. |
dragEnter | Broadcast to the drop target when a drag initiator passes over the target. Only components that define a handler for this event can be drop targets. Within the handler, you can change the appearance of the drop target to provide visual feedback to the user that the component can accept the drag. For example, you could draw a border around the drop target, or give focus to the drop target. Target contains a reference to the component that triggered the event. Type contains the name of the event. |
dragOver | Broadcast to the drop target when the user moves the mouse over the target. You can handle this event if you want to perform additional logic before allowing the drop, such as dropping data to various locations within the drop target, reading keyboard input to determine if the drag and drop action is a move or copy of the drag data, or providing different types of visual feedback based on the type of drag and drop action. Target contains a reference to the component that triggered the event. Type contains the name of the event. |
dragExit | Broadcast to the drop target when the user drags outside the drop target, but does not drop the data onto the target. You can use this event to restore the drop target to its normal appearance if you modified its appearance as part of handling the dragEnter event. Target contains a reference to the component that triggered the event. Type contains the name of the event. |
dragDrop | Broadcast to the drop target when the mouse is released over it. You use this event handler to add the drag data to the drop target. Target contains a reference to the component that triggered the event. Type contains the name of the event. |
| Styles | |
color |
Type: Number
Format: Color
CSS Inheritance: yes
Text color of a component label. |
fontFamily |
Type: String
CSS Inheritance: yes
Comma-separated list of fonts to use, in descending order of desirability. Any font family name can be used. If you specify a generic font name, it will be converted to an appropriate device font. |
fontSize |
Type: Number
Format: Length
CSS Inheritance: yes
Size of the text. |
fontStyle |
CSS Inheritance: yes
Whether the text is italic or not. Recognized values are normal and italic. The default is normal. |
fontWeight |
CSS Inheritance: yes
Whether the text is bold or not. Recognized values are normal and bold. The default is normal. |
textAlign |
CSS Inheritance: yes
Alignment of text within a container. Recognized values are left, right, or center. The default is right. |
textDecoration |
CSS Inheritance: no
Determines whether the text is underlined or not. Recognized values are none and underline. The default is none. |
textIndent |
Type: Number
Format: Length
CSS Inheritance: yes
Offset of first line of text from the left side of the container. The default is 0. |
marginLeft |
Type: Number
Format: Length
CSS Inheritance: no
Number of pixels between the container`s left border and its content area. |
marginRight |
Type: Number
Format: Length
CSS Inheritance: no
Number of pixels between the container`s right border and its content area. |
horizontalGap |
Type: Number
Format: Length
CSS Inheritance: no
Number of pixels between children in the horizontal direction. |
verticalGap |
Type: Number
Format: Length
CSS Inheritance: no
Number of pixels between children in the vertical direction. |
| Constructor Detail |
UIObject()
| Method Detail |
addEventListener() :
Void
addEventListener(event:String, listener):Void
See Also
mx.events.EventDispatcher
cancelAllDoLaters() : Void
createAccessibilityImplementation() :
Void
See Also
mx.accessibility.accImpl
createClassObject(classRef:Function, name:String, depth:Number, initObj:Object) : UIObject
Parameters
classRef - Reference to the class of the object.
name - Instance name of the object.
depth - Indicates the z order of the object.
initObj - Object that contains initialization properties.
Returns
Reference to the object.
createEmptyObject(name:String, depth:Number) : UIObject
Parameters
name - Instance name of the object.
depth - Indicates the z order of the object.
Returns
Reference to the object.
destroyLabel(name:String) : Void
Parameters
name - Instance name of text object to destroy.
destroyObject(name:String) : Void
Parameters
name - Instance name of the object.
dispatchEvent() :
Void
dispatchEvent(eventObj:Object) : Boolean
See Also
mx.events.EventDispatcher
doLater(obj:Object, fn:String, args:Array) : Void
Parameters
obj - Object that contains the function.
fn - Name of the function on the object.
args - Array of arguments to pass to the function specified by the fn parameter.
drawRect(x1:Number, y1:Number, x2:Number, y2:Number, r) : Void
Parameters
x1 - Horizontal position of one corner. Note: (x1, y1) is one corner of the rectangle.
y1 - Vertical position of one corner. Note: (x1, y1) is one corner of the rectangle.
x2 - Horizontal position of the corner diagonally opposite the first corner. Note: (x2, y2) is the other corner of the rectangle.
y2 - Vertical position of the corner diagonally opposite the first corner. Note: (x2, y2) is the other corner of the rectangle.
r - Corner radius of the rectangle or object containing radii for each corner.
fillRect(x1:Number, y1:Number, x2:Number, y2:Number, rgb:Number, alpha:Number) : Void
Parameters
x1 - Horizontal position of one corner. Note: (x1, y1) is one corner of the rectangle.
y1 - Vertical position of one corner. Note: (x1, y1) is one corner of the rectangle.
x2 - Horizontal position of the corner diagonally opposite the first corner. Note: (x2, y2) is the other corner of the rectangle.
y2 - Vertical position of the corner diagonally opposite the first corner. Note: (x2, y2) is the other corner of the rectangle.
rgb - Fill color.
alpha - Transparency, where 0=transparent, and 100=opaque.
getRepeaterItem() :
Void
getRepeaterItem(whichRepeater). This method returns the item in the dataProvider that was used by the specified Repeater to produce this Repeater, or undefined if this Repeater isn`t repeated. The argument whichRepeater is 0 for the outermost Repeater, 1 for the next inner Repeater, and so on. If whichRepeater is not specified, the innermost Repeater is used.
getStyle(styleProp:String) :
Void
Parameters
styleProp - Name of the style property.
Returns
Style value.
handleEvent() :
Void
handleEvent(event:Object) : Void
See Also
mx.events.EventDispatcher
invalidate() : Void
invalidateProperties() : Void
invalidateSize() : Void
invalidateStyle(styleProp:String) : Void
Parameters
styleProp - Style property.
measure() : Void
move(x:Number, y:Number, noEvent:Boolean) : Void
Parameters
x - Left position of the object.
y - Top position of the object.
noEvent - If true, it does not broadcast a move event.
redraw(bAlways:Boolean) : Void
Parameters
bAlways - If false, it does not redraw if not invalidated.
removeEventListener() :
Void
removeEventListener(event:String, listener) : Void
See Also
mx.events.EventDispatcher
setMask(mask_mc:MovieClip) :
Void
Parameters
mask_mc - Mask that is currently applied to this object.
setSize(w:Number, h:Number, noEvent:Boolean) : Void
Parameters
w - Width of the object.
h - Height of the object.
noEvent - If true, it does not broadcast resize event.
setSizeNoLayout(w:Number, h:Number, noEvent:Boolean) : Void
Parameters
w - Width of the object.
h - Height of the object.
noEvent - If true, it does not broadcast resize event.
setStyle() :
Void
setStyle(styleProp:String, newValue) : Void
swapDepths(target) : Void
Parameters
target - UIObject to swap with.
| Property Detail |
alpha:Void
[Write-Only]
baselinePosition:Number
[Read-Only]
className:String
depth:Number
[Read-Only]
descriptor:Object
[Read-Only]
documentDescriptor:Object
[Read-Only]
height:Number
[Read-Write]
heightFlex:Number
[Read-Write]
id:String
[Read-Write]
instanceIndices:Array
isDocument:Boolean
[Read-Only]
static kStretch:Number
maxHeight:Number
[Read-Write]
maxWidth:Number
[Read-Write]
minHeight:Number
[Read-Write]
minWidth:Number
[Read-Write]
mouseX:Number
[Read-Only]
mouseY:Number
[Read-Only]
nestLevel:Number
parentApplication:Object
[Read-Only]
parentDocument:Object
[Read-Only]
preferredHeight:Number
[Read-Write]
preferredWidth:Number
[Read-Write]
repeaterIndices:Array
scaleX:Number
[Read-Write]
scaleY:Number
[Read-Write]
styleName:String
toolTip:String
static version:String
visible:Boolean
[Read-Write]
width:Number
[Read-Write]
widthFlex:Number
[Read-Write]
x:Number
[Read-Write]
y:Number
[Read-Write]