mx.core
Class View


Direct Known Subclasses
           mx.containers.Container, mx.controls.Loader, mx.controls.MediaPlayback, mx.core.ScrollView

class View
extends mx.core.UIComponent

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 

Methods inherited from class mx.core.UIObject
createAccessibilityImplementation  measure  doLater  cancelAllDoLaters  invalidate  invalidateStyle  invalidateProperties  invalidateSize  redraw  move  setSize  setSizeNoLayout  drawRect  fillRect  destroyLabel  createClassObject  createEmptyObject  destroyObject  getStyle  setMask  swapDepths 


Properties
staticversion: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 

Properties inherited from class mx.core.UIObject
version  nestLevel  dispatchEvent  addEventListener  handleEvent  removeEventListener  kStretch  styleName  className  setStyle  parentApplication  isDocument  parentDocument  documentDescriptor  descriptor  instanceIndices  repeaterIndices  getRepeaterItem  id  width  height  x  y  minHeight  minWidth  preferredHeight  preferredWidth  maxHeight  maxWidth  widthFlex  heightFlex  visible  scaleX  scaleY  alpha  depth  mouseX  mouseY  toolTip  baselinePosition 


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
childCreatedBroadcast 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.
childIndexChangedBroadcast 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.
childDestroyedBroadcast 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 

Events inherited from class: mx.core.UIObject
initialize  creationComplete  resize  move  draw  load  unload  mouseDown  mouseUp  mouseMove  mouseOver  mouseOut  mouseDownSomewhere  mouseUpSomewhere  mouseMoveSomewhere  mouseChangeSomewhere  effectStart  effectEnd  dragBegin  dragComplete  dragEnter  dragOver  dragExit  dragDrop 


Styles

Styles inherited from class mx.core.UIComponent
backgroundColor  backgroundDisabledColor  backgroundImage  backgroundAlpha  backgroundSize  barColor  borderCapColor  borderColor  buttonColor  borderStyle  disabledColor  errorColor  highlightColor  lineHeight  modalTransparency  scrollTrackColor  shadowColor  shadowCapColor  symbolColor  symbolBackgroundColor  symbolBackgroundDisabledColor  symbolBackgroundPressedColor  symbolDisabledColor  themeColor 

Styles inherited from class mx.core.UIObject
color  fontFamily  fontSize  fontStyle  fontWeight  textAlign  textDecoration  textIndent  marginLeft  marginRight  horizontalGap  verticalGap 


Constructor Detail

View

View()

Constructor.


Method Detail

createChild

createChild(classOrSymbol, name:String, initProps:Object) : MovieClip

Adds a new child object.

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

destroyAllChildren() : Void

Destroys all children.


destroyChild

destroyChild(child:UIObject) : Void

Destroys one child.

Parameters
     child - Child to desctroy.


destroyChildAt

destroyChildAt(childIndex:Number) : Void

Destroys the nth child object. Remaining child objects are renumbered.

Parameters
     childIndex - Number from 0 to n-1.

Returns
     Reference to the child.


draw

draw() : Void

Redraws by laying out again.


getChildAt

getChildAt(childIndex:Number) : UIObject

Gets the nth child object.

Parameters
     childIndex - Number from 0 to n-1.

Returns
     Reference to the child.


getChildIndex

getChildIndex(child:UIObject) : Number

Gets the ID of a specific child.

Parameters
     child - Child whose ID to get.


getViewMetrics

getViewMetrics() : Object

Returns an object that has four properties: top, bottom, left, right. The value of each property is equal to the thickness of the border, and any other chrome that should be taken into account when positioning the container`s children.


init

init() : Void

Initializes variables.


setChildIndex

setChildIndex(child:UIObject, newIndex:Number) : Void

Sets the ID of a particular child.

Parameters
     child - Child whose ID to set.
     newIndex - Number that indicates the new ID.


Property Detail

className

className:String  

Name of this class.


numChildren

numChildren:Number   [Read-Only]

Number of children in this View.


version

static version:String  

ComponentVersion is for internal use only.