User Guide
UIComponent class 793
UIComponent class
The UIComponent class does not represent a visual component; it contains methods, properties,
and events that allow Macromedia components to share some common behavior. All version 2
components extend UIComponent. The UIComponent class lets you do the following:
• Receive focus and keyboard input
• Enable and disable components
• Resize by layout
To use the methods and properties of UIComponent, you call them directly from whichever
component you are using. For example, to call
UIComponent.setFocus() from the RadioButton
component, you would write the following code:
myRadioButton.setFocus();
You only need to create an instance of UIComponent if you are using version 2 of the
Macromedia Component Architecture to create a new component. Even in that case,
UIComponent is often created implicitly by other subclasses such as Button. If you do need to
create an instance of UIComponent, use the following code:
class MyComponent extends mx.core.UIComponent;
UIComponent class (API)
Inheritance MovieClip > UIObject class > UIComponent
ActionScript Class Name mx.core.UIComponent
The methods, properties, and events of the UIComponent class allow you to control the common
behavior of Flash visual components.
Method summary for the UIComponent class
The following table lists methods of the UIComponent class.
Methods inherited from the UIObject class
The following table lists the methods the UIComponent class inherits from the UIObject class.
When calling these methods from the UIComponent object, use the form
UIComponentInstance.methodName.
Method Description
UIComponent.getFocus() Returns a reference to the object that has focus.
UIComponent.setFocus() Sets focus to the component instance.
Method Description
UIObject.createClassObject() Creates an object on the specified class.
UIObject.createObject() Creates a subobject on an object.
UIObject.destroyObject() Destroys a component instance.
CHAPTER 6
Components Dictionary