<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Flex Examples &#187; BoxDirection</title>
	<atom:link href="http://blog.flexexamples.com/category/boxdirection/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Wed, 26 Jan 2011 18:09:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Changing a Box container&#8217;s direction in Flex</title>
		<link>http://blog.flexexamples.com/2008/01/04/changing-a-box-containers-direction-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/01/04/changing-a-box-containers-direction-in-flex/#comments</comments>
		<pubDate>Sat, 05 Jan 2008 07:21:51 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Box]]></category>
		<category><![CDATA[BoxDirection]]></category>
		<category><![CDATA[direction]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/04/changing-a-box-containers-direction-in-flex/</guid>
		<description><![CDATA[<p>The following example shows you how you can change the direction of a Box container in Flex by setting the direction property to one of the constants in the BoxDirection class. The &#60;mx:Box /&#62; container is the superclass of the HBox container and VBox container. The subclasses (HBox and VBox) do not add any new [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows you how you can change the direction of a Box container in Flex by setting the <code>direction</code> property to one of the constants in the BoxDirection class. The &lt;mx:Box /&gt; container is the superclass of the HBox container and VBox container. The subclasses (HBox and VBox) do not add any new functionality, they simply set the <code>direction</code> property automatically to &#8220;horizontal&#8221; or &#8220;vertical&#8221;.</p>
<p>Full code after the jump.</p>
<p><span id="more-424"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Box_direction_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/01/04/changing-a-box-containers-direction-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        .myBox {
            paddingLeft: 10;
            paddingRight: 10;
            paddingTop: 10;
            paddingBottom: 10;
            backgroundColor: haloSilver;
        }
    &lt;/mx:Style&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.events.ListEvent;
            import mx.containers.BoxDirection;

            private function comboBox_init():void {
                var arr:Array = [];
                arr.push({label:BoxDirection.HORIZONTAL});
                arr.push({label:BoxDirection.VERTICAL});
                comboBox.dataProvider = arr;
            }

            private function comboBox_change(evt:ListEvent):void {
                box.direction = comboBox.selectedLabel;
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="direction:"&gt;
                &lt;mx:ComboBox id="comboBox"
                        initialize="comboBox_init();"
                        change="comboBox_change(event);" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:Box id="box" direction="horizontal" styleName="myBox"&gt;
        &lt;mx:Image source="Button.png" toolTip="Button" /&gt;
        &lt;mx:Image source="ButtonBar.png" toolTip="ButtonBar" /&gt;
        &lt;mx:Image source="CheckBox.png" toolTip="CheckBox" /&gt;
        &lt;mx:Image source="ColorPicker.png" toolTip="ColorPicker" /&gt;
        &lt;mx:Image source="ComboBox.png" toolTip="ComboBox" /&gt;
    &lt;/mx:Box&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Box_direction_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/Box_direction_test/bin/main.html" width="100%" height="250"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Changing a Box container\&#039;s direction in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/01/04/changing-a-box-containers-direction-in-flex/',contentID: 'post-424',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'direction',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/01/04/changing-a-box-containers-direction-in-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

