View comments | RSS feed

UIObject class

Inheritance MovieClip > UIObject

ActionScript Class Name mx.core.UIObject

UIObject is the base class for all components; it is not a visual component.

NOTE

 

The UIObject class is supported only if you are working in a document that specifies ActionScript 2.0 in its Publish Settings.

The UIObject class wraps the ActionScript MovieClip object and contains functions and properties that allow components to share some common behavior. Wrapping the MovieClip class allows Adobe to add new events and extend functionality in the future without breaking content. Wrapping the MovieClip class also allows users who aren't familiar with the traditional Flash concepts of "movie" and "frame" to use properties, methods, and events to create component-based applications without learning those concepts.

The UIObject class implements the following:

To use the methods and properties of the UIObject class, 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 creating 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

The following table lists methods of the UIObject class.

Method

Description

UIObject.createClassObject()

Creates an object on the specified class.

UIObject.createLabel()

Creates a TextField subobject, for use when creating components.

UIObject.createObject()

Creates a subobject on an object.

UIObject.destroyObject()

Destroys a component instance.

UIObject.doLater()

Calls a function when parameters have been set in the Property and Component inspectors.

UIObject.getStyle()

Gets the style property from the style declaration or object.

UIObject.invalidate()

Marks the object so it is redrawn on the next frame interval.

UIObject.move()

Moves the object to the requested position.

UIObject.redraw()

Forces validation of the object so it is drawn in the current frame.

UIObject.setSize()

Resizes the object to the requested size.

UIObject.setSkin()

Sets a skin in the object.

UIObject.setStyle()

Sets the style property on the style declaration or object.

Property summary for the UIObject class

The following table lists properties of the UIObject class.

Property

Description

UIObject.bottom

The position of the bottom edge of the object, relative to the bottom edge of its parent. Read-only.

UIObject.height

The height of the object, in pixels. Read-only.

UIObject.left

The left edge of the object, in pixels. Read-only.

UIObject.right

The position of the right edge of the object, relative to the right edge of its parent. Read-only.

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. Read-only.

UIObject.visible

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

UIObject.width

The width of the object, in pixels. Read-only.

UIObject.x

The left edge of the object, in pixels. Read-only.

UIObject.y

The top edge of the object, in pixels. Read-only.

Event summary for the UIObject class

The following table lists events of the UIObject class.

Event

Description

UIObject.draw

Broadcast when an object is about to draw its graphics.

UIObject.hide

Broadcast when an object's state changes from visible to invisible.

UIObject.load

Broadcast when subobjects are being created.

UIObject.move

Broadcast when the object has moved.

UIObject.resize

Broadcast when an object has been resized.

UIObject.reveal

Broadcast when an object's state changes from invisible to visible.

UIObject.unload

Broadcast when the subobjects are being unloaded.


Flash CS3


Comments


pan69 said on Jan 13, 2008 at 3:15 PM :
UIObject seems to define a public 'init' method which is not mentioned in the documention. When by subclass of UIObject implements an 'init' method as well I'm forced to call super.init().

Can you either please list 'init' as a public method in the API list in the documention (as well as the other undocumented public methods of UIObject). Or, rename 'init' in UIObject to something more appropriate, like _init, and make it private.

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/9.0/main/00003651.html