Direct Known Subclasses
The View class is an abstract base class. You do not create an instance of a View itself in an application. Instead, you create an instance of one of View`s subclasses, such as Canvas or HBox.
The View class contains methods for creating and destroying children. It also contains the getChildAt method, and the logic for drawing the background and border of the View instance.
Common MXML Syntax Inherited from View
Flex components inherit the following properties from the View class.
<mx:tagname
numchildren=No default.
/>
| Constructors | |
View
()
Constructor. |
|
| Methods | |
| createChild(classOrSymbol, name:String, initProps:Object) : MovieClip
Adds a new child object. |
| destroyAllChildren() : Void
Destroys all children. |
| destroyChild(child:UIObject) : Void
Destroys one child. |
| destroyChildAt(childIndex:Number) : Void
Destroys the nth child object. |
| draw() : Void
Redraws by laying out again. |
| getChildAt(childIndex:Number) : UIObject
Gets the nth child object. |
| getChildIndex(child:UIObject) : Number
Gets the ID of a specific child. |
| getViewMetrics() : Object
Returns an object that has four properties: top, bottom, left, right. |
| init() : Void
Initializes variables. |
| setChildIndex(child:UIObject, newIndex:Number) : Void
Sets the ID of a particular child. |
| Methods inherited from class mx.core.UIComponent |
getFocus
setFocus
getFocusManager
|
| Properties | |
static | version:String
ComponentVersion is for internal use only. |
| className:String
Name of this class. |
| numChildren:Number
[Read-Only]
Number of children in this View. |
| Properties inherited from class mx.core.UIComponent |
version
enabled
tabIndex
|
| Effects |
| Effects inherited from class mx.core.UIComponent |
showEffect
hideEffect
focusInEffect
focusOutEffect
|
| Effects inherited from class mx.core.UIObject |
creationCompleteEffect
moveEffect
resizeEffect
mouseDownEffect
mouseOverEffect
mouseOutEffect
mouseUpEffect
|
| Events | |
childCreated | Broadcast after a child has been created in a container. The relatedNode property of the event object contains a copy of the created child object. Target contains a reference to the component that triggered the event. Type contains the name of the event. |
childIndexChanged | Broadcast after a container child`s index has changed. The event object contains the following properties: - relatedNode Contains a copy of the created child object. - prevValue Contains the child`s old index. - newValue Contains the child`s new index. Target contains a reference to the component that triggered the event. Type contains the name of the event. |
childDestroyed | Broadcast before a child of a container is destroyed. The relatedNode property of the event object contains a copy of the destroyed child object. Target contains a reference to the component that triggered the event. Type contains the name of the event. |
| Events inherited from class: mx.core.UIComponent |
focusIn
focusOut
keyDown
keyUp
show
hide
valid
invalid
valueCommitted
|
| Styles |
| Styles inherited from class mx.core.UIObject |
color
fontFamily
fontSize
fontStyle
fontWeight
textAlign
textDecoration
textIndent
marginLeft
marginRight
horizontalGap
verticalGap
|
| Constructor Detail |
View()
| Method Detail |
createChild(classOrSymbol, name:String, initProps:Object) : MovieClip
Parameters
classOrSymbol - Reference to a class, the linkage ID of a symbol, or file path or URL to the external content. Note: Specify the class name without using double quotation marks; do not specify the component as a String.
name - Instance name of the child.
initProps - Object that contains initialization properties.
Returns
Reference to the child object.
destroyAllChildren() : Void
destroyChild(child:UIObject) : Void
Parameters
child - Child to desctroy.
destroyChildAt(childIndex:Number) : Void
Parameters
childIndex - Number from 0 to n-1.
Returns
Reference to the child.
draw() : Void
getChildAt(childIndex:Number) : UIObject
Parameters
childIndex - Number from 0 to n-1.
Returns
Reference to the child.
getChildIndex(child:UIObject) : Number
Parameters
child - Child whose ID to get.
getViewMetrics() : Object
init() : Void
setChildIndex(child:UIObject, newIndex:Number) : Void
Parameters
child - Child whose ID to set.
newIndex - Number that indicates the new ID.
| Property Detail |
className:String
numChildren:Number
[Read-Only]
static version:String