Box Container in Flex4


 

Box Container in Flex4

The Box container is a MX component. There is no Spark Component. The Box container is used for both horizontal and vertical layout in which the children components are arrange in horizontal and vertical manner respectively.

The Box container is a MX component. There is no Spark Component. The Box container is used for both horizontal and vertical layout in which the children components are arrange in horizontal and vertical manner respectively.

Box container in Flex4:

The Box container is a MX component. There is no Spark Component. The Box container is used for both horizontal and vertical layout in which the children components are arrange in horizontal and vertical manner respectively. You can set the direction property for horizontal and vertical layout.
The tag of Box Container is <mx:Box>.

In this example you can see that how we can use the Box container as horizontally and vertically.

Example:

<?xml version="1.0" encoding="utf-8"?>

<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

xmlns:s="library://ns.adobe.com/flex/spark"

xmlns:mx="library://ns.adobe.com/flex/mx"

minWidth="955" minHeight="600">

<s:Panel title="Box Container Example"

width="466" height="325"

contentBackgroundColor="#000000">

<s:VGroup x="10" y="10"

horizontalAlign="center"

paddingBottom="10"

paddingLeft="10"

paddingRight="10"

paddingTop="10">

<mx:Box direction="horizontal"

borderStyle="solid"

paddingTop="10"

paddingBottom="10"

paddingLeft="10"

paddingRight="10"

backgroundColor="#2F8F95"

borderAlpha="3"

borderColor="#230909"

cornerRadius="20">

<s:TextInput id="txt" text="User Name"

color="#ffffff" fontFamily="verdana"/>

<mx:Button id="btn" label="Button 1"/>

<mx:Button id="btn1" label="Button 2"/>

0

<mx:ComboBox id="comb"

prompt="Select Item"

color="#ffffff"

1

chromeColor="#000000"

cornerRadius="10"

direction="rtl"

2

symbolColor="#FFFFFF"

fontFamily="verdana">

<mx:ArrayList>

3

<fx:String>Item 1</fx:String>

<fx:String>Item 2</fx:String>

<fx:String>Item 3</fx:String>

4

<fx:String>Item 4</fx:String>

</mx:ArrayList>

</mx:ComboBox>

5

</mx:Box>

<mx:Box direction="vertical"

borderStyle="solid"

6

paddingTop="10"

paddingBottom="10"

paddingLeft="10"

7

paddingRight="10"

backgroundColor="#2F8F95"

cornerRadius="20"

8

borderAlpha="3"

borderColor="#250707">

<s:TextInput id="txt1" text="User Name"

9

color="#ffffff" fontFamily="verdana"/>

<mx:Button id="btn2" label="Button 1"/>

<mx:Button id="btn3" label="Button 2"/>

0

<mx:ComboBox id="comb1"

prompt="Select Item"

color="#ffffff"

1

chromeColor="#000000"

cornerRadius="10"

direction="rtl"

2

symbolColor="#FFFFFF"

width="127"

fontFamily="verdana">

3

<mx:ArrayList>

<fx:String>Item 1</fx:String>

<fx:String>Item 2</fx:String>

4

<fx:String>Item 3</fx:String>

<fx:String>Item 4</fx:String>

</mx:ArrayList>

5

</mx:ComboBox>

</mx:Box>

</s:VGroup>

6

</s:Panel>

</s:Application>

Output:

Running Application:

To view this page ensure that Adobe Flash Player version 10.0.0 or greater is installed.

7

Download this code

Ads