mx.core

# ContainerLayout - AS3 Flex

Package | mx.core
Class | public final class ContainerLayout
Inheritance | ContainerLayout Object

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

The ContainerLayout class defines the constant values for the `layout` property of container classes.

Related API Elements

mx.containers.Panel.layout
mx.core.Application.layout

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | constructor : Object A reference to the class object or constructor function for a given object instance. | Object

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | hasOwnProperty(name:String):Boolean Indicates whether an object has a specified property defined. | Object
|  | isPrototypeOf(theClass:Object):Boolean Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter. | Object
|  | propertyIsEnumerable(name:String):Boolean Indicates whether the specified property exists and is enumerable. | Object
|  | setPropertyIsEnumerable(name:String, isEnum:Boolean = true):void Sets the availability of a dynamic property for loop operations. | Object
|  | toLocaleString():String Returns the string representation of this object, formatted according to locale-specific conventions. | Object
|  | toString():String Returns the string representation of the specified object. | Object
|  | valueOf():Object Returns the primitive value of the specified object. | Object

Public Constants

| Constant | Defined By
--- | --- | ---
|  | ABSOLUTE : String = "absolute" [static] Use absolute layout for the contents of this container. | ContainerLayout
|  | HORIZONTAL : String = "horizontal" [static] Use horizontal layout for the contents of this container. | ContainerLayout
|  | VERTICAL : String = "vertical" [static] Use vertical layout for the contents of this container. | ContainerLayout

Constant Detail

### ABSOLUTE

Constant

`public static const ABSOLUTE:String = "absolute"`

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

Use absolute layout for the contents of this container. You are responsible for explicitly specifying the position of each child.

The easiest way to do this is to specify the `x`, `y`, `width`, and `height` of each child.

The `width` and `height` can be specified as a percentage value in MXML. (In ActionScript you have to set the `percentWidth` and `percentHeight` properties.)

If you don't specify the `width` or `percentWidth` for a child, then its `measuredWidth`, as automatically determined by its `measure()` method, will be used. The same applies for its height.

As an alternative way of doing layout, you can use the anchor styles `left`, `top`, `right` , `bottom`, `horizontalCenter`, and `verticalCenter` on children to anchor them to the sides or the center of a container.

When you use absolute layout, the container's `paddingLeft`, `paddingTop`, `paddingRight`, `paddingBottom`, `horizontalGap`, `verticalGap`, `horizontalAlign`, and`verticalAlign` styles are ignored.

### HORIZONTAL

Constant

`public static const HORIZONTAL:String = "horizontal"`

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

Use horizontal layout for the contents of this container. The container will automatically place its children in a single row.

If you don't specify the `width` or `percentWidth` for a child, then its `measuredWidth`, as automatically determined by its `measure()` method, is used. The same applies for its height.

You can control the spacing between children with the `horizontalGap` style, and the alignment of the children with the `verticalAlign` style. The `paddingLeft`, `paddingTop`, `paddingRight`, and `paddingBottom` styles control the space between the border of the container and the children.

### VERTICAL

Constant

`public static const VERTICAL:String = "vertical"`

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

Use vertical layout for the contents of this container. The container will automatically place its children in a single column.

If you don't specify the `width` or `percentWidth` for a child, then its `measuredWidth`, as automatically determined by its `measure()` method, is used. The same applies for its height.

You can control the spacing between children with the `verticalGap` style, and the alignment of the children with the `horizontalAlign` style. The `paddingLeft`, `paddingTop`, `paddingRight`, and `paddingBottom` styles control the space between the border of the container and the children.

© 2015 Adobe Systems Incorporated. All rights reserved.
Mon Apr 10 2017, 12:28 PM -07:00