About the UIObject class

Inheritance MovieClip > UIObject

ActionScript class namespace mx.core.UIObject

UIObject is the base class for all v2 components; it is not a visual component. The UIObject class wraps the ActionScript MovieClip object and contains functions and properties that allow Macromedia v2 components to share some common behavior. The UIObject class implements the following:

To use the methods and properties of the UIObject, you call them directly from whichever component you are using. For example, to call the UIObject.setSize() method from the RadioButton component, you would write the following code:

myRadioButton.setSize(30, 30);

You only need to create an instance of UIObject if you are using the Macromedia Component V2 Architecture to create a new component. Even in that case, UIObject is often created implicitly by other subclasses like Button. If you do need to create an instance of UIObject, use the following code:

class MyComponent extends UIObject;

Method summary for the UIObject class

Method

Description

UIObject.createObject()

Creates a subobject on an object.

UIObject.createClassObject()

Creates an object on the specified class.

UIObject.destroyObject()

Destroys a component instance.

UIObject.invalidate()

Marks the object so it will be redrawn on the next frame interval.

UIObject.move()

Moves the object to the requested position.

UIObject.redraw()

Forces validation of the object so it draws in the current frame.

UIObject.setSize()

Resizes the object to the requested size.

UIObject.setSkin()

Sets a skin in the object.

Property summary for the UIObject class

Property

Description

UIObject.bottom

Returns the position of the bottom edge of the object relative to the bottom edge of its parent.

UIObject.height

The height of the object in pixels.

UIObject.left

The left position of the object in pixels.

UIObject.right

The position of the right edge of the object relative to the right edge of its parent.

UIObject.scaleX

A number indicating the scaling factor in the x direction of the object relative to its parent.

UIObject.scaleY

A number indicating the scaling factor in the y direction of the object relative to its parent.

UIObject.top

The position of the top edge of the object relative to its parent.

UIObject.visible

A Boolean value indicating whether the object is visible (true) or not (false).

UIObject.width

The width of the object in pixels.

UIObject.x

The left position of the object in pixels.

UIObject.y

Returns the position of the top edge of the object relative to its parent.

Event summary for the UIObject class

Event

Description

UIObject.draw

Broadcast when an object is about to draw its graphics.

UIObject.load

Broadcast when subobjects are being created.

UIObject.move

Broadcast when the object has moved.

UIObject.resize

Broadcast when the subobjects are being unloaded.

UIObject.unload

Broadcast when the subobjects are being unloaded.