Class org.aswing.Container

Description

Container can contain many component to be his child, all children are in its bounds, and it moved, all children moved. It be removed(destroy) all children will be removed.

Field Index

ON_COM_ADDED, ON_COM_REMOVED

Inherited from Component

Inherited from EventDispatcher

Method Index

__onChildPressed(), addTo(), append(), contains(), createChildMC(), destroy(), doLayout(), getComponent(), getComponentCount(), getLayout(), index(), insert(), invalidate(), remove(), removeAll(), removeAt(), setLayout(), validate()

Inherited from Component

Inherited from EventDispatcher

Field Detail

ON_COM_ADDED

static public ON_COM_ADDED:String
Event include source and the component just removed. onComponentAdded Event{source:Component, com:Component}

ON_COM_REMOVED

static public ON_COM_REMOVED:String
Event include source and the component just added. onComponentRemoved Event{source:Component, com:Component}

Method Detail

setLayout

public function setLayout(layout:LayoutManager):Void

getLayout

public function getLayout():LayoutManager

invalidate

public function invalidate():Void

Invalidates the container. The container and all parents above it are marked as needing to be laid out. This method can be called often, so it needs to execute quickly.

Overrides

invalidate() in org.aswing.Component

See Also

validate

public function validate():Void

Validates this container and all of its subcomponents.

The validate method is used to cause a container to lay out its subcomponents again. It should be invoked when this container's subcomponents are modified (added to or removed from the container, or layout-related information changed) after the container has been displayed.

Overrides

validate() in org.aswing.Component

See Also

doLayout

public function doLayout():Void

layout this container

addTo

public function addTo(parent:Container):Void

Create and add this component to a Container. the method must only can call in a Container's method, else the Container's layout maybe wrong and Container event will not be called

destroy

public function destroy():Void

Destroy a Container. A Container was called destroy, it will call its children destroy first, This can ensure that all its children as not displayable after it be removed.

Overrides

destroy() in org.aswing.Component

See Also

createChildMC

public function createChildMC(nameStart:String):MovieClip

append

public function append(com:Component, constraints:Object):Void

On Component just can add to one Container. So if the com has a parent, it will remove from its parent first, then add to this container. This method is shortcut of insert(-1, com, constraints).

Parameters

comthe component to be added
constraintsan object expressing layout contraints for this component

See Also

insert

public function insert(i:Number, com:Component, constraints:Object):Void

Add component to spesified index. So if the com has a parent, it will remove from its parent first, then add to this container.

Parameters

iindex the position at which to insert the component, or less than 0 value to append the component to the end
comthe component to be added
constraintsan object expressing layout contraints for this component

Throws

Errorwhen index > children count
Errorwhen add container's parent(or itself) to itself

See Also

remove

public function remove(com:Component):Component

Remove the specified child component.

Return

the component just removed, null if the component is not in this container.

removeAt

public function removeAt(i:Number):Component

Remove the specified index child component.

Parameters

ithe index of component, less than 0 mean the component in the end of children list.

Return

the component just removed. or null there is not component at this position.

removeAll

public function removeAll():Void

Remove all child components.

contains

public function contains(com:Component):Boolean

getComponent

public function getComponent(i:Number):Component

index

public function index(com:Component):Number

getComponentCount

public function getComponentCount():Number

__onChildPressed

public function __onChildPressed(child:Component):Void

When child component pressed.

See Also