<?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; VDividedBox</title>
	<atom:link href="http://blog.flexexamples.com/category/halo/vdividedbox/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>Setting a custom divider alpha on the DividedBox container in Flex</title>
		<link>http://blog.flexexamples.com/2008/10/14/setting-a-custom-divider-alpha-on-the-dividedbox-container-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/10/14/setting-a-custom-divider-alpha-on-the-dividedbox-container-in-flex/#comments</comments>
		<pubDate>Wed, 15 Oct 2008 03:53:35 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[HDividedBox]]></category>
		<category><![CDATA[VDividedBox]]></category>
		<category><![CDATA[dividerAlpha]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/10/14/setting-a-custom-divider-alpha-on-the-dividedbox-container-in-flex/</guid>
		<description><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2008/09/17/setting-a-custom-divider-color-on-the-dividedbox-container-in-flex/">&#8220;Setting a custom divider color on the DividedBox container in Flex&#8221;</a>, we saw how you could set a custom divider color on a Flex DividedBox container (HDividedBox or VDividedBox) by setting the dividerColor style.</p> <p>The following example shows how you can set a custom divider alpha on a Flex DividedBox [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2008/09/17/setting-a-custom-divider-color-on-the-dividedbox-container-in-flex/">&#8220;Setting a custom divider color on the DividedBox container in Flex&#8221;</a>, we saw how you could set a custom divider color on a Flex DividedBox container (HDividedBox or VDividedBox) by setting the <code>dividerColor</code> style.</p>
<p>The following example shows how you can set a custom divider alpha on a Flex DividedBox container (HDividedBox or VDividedBox) by setting the <code>dividerAlpha</code> style.</p>
<p>Full code after the jump.</p>
<p><span id="more-831"></span></p>
<p class="download"><a href="">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/10/14/setting-a-custom-divider-alpha-on-the-dividedbox-container-in-flex/ --&gt;
&lt;mx:Application name="HDividedBox_dividerAlpha_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="dividerAlpha:"
                    direction="horizontal"&gt;
                &lt;mx:HSlider id="slider"
                        minimum="0.0"
                        maximum="1.0"
                        value="0.75"
                        snapInterval="0.05"
                        tickInterval="0.1"
                        liveDragging="true" /&gt;
                &lt;mx:Label text="{Math.round(slider.value * 100)}%" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:HDividedBox id="dividedBox"
            dividerAlpha="{slider.value}"
            width="100%"
            height="100%"&gt;
        &lt;mx:Box id="box1"
                backgroundColor="haloGreen"
                width="100%"
                height="100%"
                minWidth="100" /&gt;
        &lt;mx:Box id="box2"
                backgroundColor="haloBlue"
                width="100%"
                height="100%"
                minWidth="100" /&gt;
    &lt;/mx:HDividedBox&gt;

&lt;/mx:Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting a custom divider alpha on the DividedBox container in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/10/14/setting-a-custom-divider-alpha-on-the-dividedbox-container-in-flex/',contentID: 'post-831',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'dividerAlpha',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/10/14/setting-a-custom-divider-alpha-on-the-dividedbox-container-in-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting the vertical divider cursor on a VDividedBox container in Flex</title>
		<link>http://blog.flexexamples.com/2008/10/10/setting-the-vertical-divider-cursor-on-a-vdividedbox-container-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/10/10/setting-the-vertical-divider-cursor-on-a-vdividedbox-container-in-flex/#comments</comments>
		<pubDate>Sat, 11 Oct 2008 06:58:31 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[VDividedBox]]></category>
		<category><![CDATA[verticalDividerCursor]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/10/10/setting-the-vertical-divider-cursor-on-a-vdividedbox-container-in-flex/</guid>
		<description><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2008/10/09/setting-the-horizontal-divider-cursor-on-an-hdividedbox-container-in-flex/">&#8220;Setting the horizontal divider cursor on an HDividedBox container in Flex&#8221;</a>, we saw how to set a horizontal divider cursor on a Flex HDividedBox container by setting the horizontalDividerCursor style.</p> <p>The following example shows how you can set a vertical divider cursor on a Flex VDividedBox container by setting the [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2008/10/09/setting-the-horizontal-divider-cursor-on-an-hdividedbox-container-in-flex/">&#8220;Setting the horizontal divider cursor on an HDividedBox container in Flex&#8221;</a>, we saw how to set a horizontal divider cursor on a Flex HDividedBox container by setting the <code>horizontalDividerCursor</code> style.</p>
<p>The following example shows how you can set a vertical divider cursor on a Flex VDividedBox container by setting the <code>verticalDividerCursor</code> style.</p>
<p>Full code after the jump.</p>
<p><span id="more-824"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/VDividedBox_verticalDividerCursor_test/bin/srcview/source/main.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/10/10/setting-the-vertical-divider-cursor-on-a-vdividedbox-container-in-flex/ --&gt;
&lt;mx:Application name="VDividedBox_verticalDividerCursor_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:VDividedBox id="vDividedBox"
            verticalDividerCursor="@Embed('assets/arrow_refresh.png')"
            width="100%"
            height="100%"&gt;
        &lt;mx:HBox backgroundColor="haloGreen"
                width="100%"
                height="100%"&gt;
        &lt;/mx:HBox&gt;
        &lt;mx:HBox backgroundColor="haloBlue"
                width="100%"
                height="100%"&gt;
        &lt;/mx:HBox&gt;
    &lt;/mx:VDividedBox&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/VDividedBox_verticalDividerCursor_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/VDividedBox_verticalDividerCursor_test/bin/main.html" width="100%" height="300"></iframe></p>
<p>You can also set the <code>verticalDividerCursor</code> style using an external .CSS file or &lt;mx:Style /&gt; block, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/VDividedBox_verticalDividerCursor_test/bin/srcview/source/main2.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/10/10/setting-the-vertical-divider-cursor-on-a-vdividedbox-container-in-flex/ --&gt;
&lt;mx:Application name="VDividedBox_verticalDividerCursor_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        VDividedBox {
            verticalDividerCursor: Embed("assets/arrow_refresh.png");
        }
    &lt;/mx:Style&gt;

    &lt;mx:VDividedBox id="VDividedBox"
            width="100%"
            height="100%"&gt;
        &lt;mx:HBox backgroundColor="haloGreen"
                width="100%"
                height="100%"&gt;
        &lt;/mx:HBox&gt;
        &lt;mx:HBox backgroundColor="haloBlue"
                width="100%"
                height="100%"&gt;
        &lt;/mx:HBox&gt;
    &lt;/mx:VDividedBox&gt;

&lt;/mx:Application&gt;
</pre>
<p>Or, you can set the <code>verticalDividerCursor</code> style using ActionScript, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/VDividedBox_verticalDividerCursor_test/bin/srcview/source/main3.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/10/10/setting-the-vertical-divider-cursor-on-a-vdividedbox-container-in-flex/ --&gt;
&lt;mx:Application name="VDividedBox_verticalDividerCursor_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            [Embed("assets/arrow_refresh.png")]
            private const ArrowRefreshIcon:Class;

            private function vDividedBox_init():void {
                vDividedBox.setStyle("verticalDividerCursor", ArrowRefreshIcon);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:VDividedBox id="vDividedBox"
            width="100%"
            height="100%"
            initialize="vDividedBox_init();"&gt;
        &lt;mx:HBox backgroundColor="haloGreen"
                width="100%"
                height="100%"&gt;
        &lt;/mx:HBox&gt;
        &lt;mx:HBox backgroundColor="haloBlue"
                width="100%"
                height="100%"&gt;
        &lt;/mx:HBox&gt;
    &lt;/mx:VDividedBox&gt;

&lt;/mx:Application&gt;
</pre>
<p>Due to popular demand, here is the &#8220;same&#8221; example in a more ActionScript friendly format:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/VDividedBox_verticalDividerCursor_test/bin/srcview/source/main4.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/10/10/setting-the-vertical-divider-cursor-on-a-vdividedbox-container-in-flex/ --&gt;
&lt;mx:Application name="VDividedBox_verticalDividerCursor_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"
        initialize="init();"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.containers.HBox;
            import mx.containers.VDividedBox;

            [Embed("assets/arrow_refresh.png")]
            private const ArrowRefreshIcon:Class;

            private var vDividedBox:VDividedBox;
            private var hBox1:HBox;
            private var hBox2:HBox;

            private function init():void {
                hBox1 = new HBox();
                hBox1.percentWidth = 100;
                hBox1.percentHeight = 100;
                hBox1.setStyle("backgroundColor", "haloGreen");

                hBox2 = new HBox();
                hBox2.percentWidth = 100;
                hBox2.percentHeight = 100;
                hBox2.setStyle("backgroundColor", "haloBlue");

                vDividedBox = new VDividedBox();
                vDividedBox.percentWidth = 100;
                vDividedBox.percentHeight = 100;
                vDividedBox.addChild(hBox1);
                vDividedBox.addChild(hBox2);
                vDividedBox.setStyle("verticalDividerCursor",
                            ArrowRefreshIcon);
                addChild(vDividedBox);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

&lt;/mx:Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting the vertical divider cursor on a VDividedBox container in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/10/10/setting-the-vertical-divider-cursor-on-a-vdividedbox-container-in-flex/',contentID: 'post-824',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'verticalDividerCursor',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/10/10/setting-the-vertical-divider-cursor-on-a-vdividedbox-container-in-flex/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Setting the padding between children in a DividedBox in Flex</title>
		<link>http://blog.flexexamples.com/2008/09/22/setting-the-padding-between-children-in-a-dividedbox-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/09/22/setting-the-padding-between-children-in-a-dividedbox-in-flex/#comments</comments>
		<pubDate>Tue, 23 Sep 2008 05:42:47 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[HDividedBox]]></category>
		<category><![CDATA[VDividedBox]]></category>
		<category><![CDATA[horizontalGap]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/09/22/setting-the-padding-between-children-in-a-dividedbox-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can adjust the horizontal padding between children in a Flex HDividedBox container by setting the horizontalGap style.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/HDividedBox_horizontalGap_test/bin/srcview/source/main.mxml.html">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/09/22/setting-the-padding-between-children-in-a-dividedbox-in-flex/ --&#62; &#60;mx:Application name="HDividedBox_horizontalGap_test" xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:ApplicationControlBar dock="true"&#62; &#60;mx:Form styleName="plain"&#62; &#60;mx:FormItem label="horizontalGap:" direction="horizontal"&#62; &#60;mx:HSlider id="slider" minimum="6" [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can adjust the horizontal padding between children in a Flex HDividedBox container by setting the <code>horizontalGap</code> style.</p>
<p>Full code after the jump.</p>
<p><span id="more-803"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/HDividedBox_horizontalGap_test/bin/srcview/source/main.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/09/22/setting-the-padding-between-children-in-a-dividedbox-in-flex/ --&gt;
&lt;mx:Application name="HDividedBox_horizontalGap_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="horizontalGap:"
                    direction="horizontal"&gt;
                &lt;mx:HSlider id="slider"
                        minimum="6"
                        maximum="20"
                        value="10"
                        snapInterval="1"
                        tickInterval="1"
                        liveDragging="true" /&gt;
                &lt;mx:Label text="{slider.value}" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:HDividedBox id="dividedBox"
            horizontalGap="{slider.value}"
            width="100%"
            height="100%"&gt;
        &lt;mx:Box id="box1"
                backgroundColor="haloGreen"
                width="100%"
                height="100%"
                minWidth="100" /&gt;
        &lt;mx:Box id="box2"
                backgroundColor="haloBlue"
                width="100%"
                height="100%"
                minWidth="100" /&gt;
    &lt;/mx:HDividedBox&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/HDividedBox_horizontalGap_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/HDividedBox_horizontalGap_test/bin/main.html" width="100%" height="250"></iframe></p>
<p>You can also set the <code>horizontalGap</code> style in an external .CSS file or &lt;mx:Style /&gt; block, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/HDividedBox_horizontalGap_test/bin/srcview/source/main2.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/09/22/setting-the-padding-between-children-in-a-dividedbox-in-flex/ --&gt;
&lt;mx:Application name="HDividedBox_horizontalGap_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        HDividedBox {
            horizontalGap: 6;
        }
    &lt;/mx:Style&gt;

    &lt;mx:HDividedBox id="dividedBox"
            width="100%"
            height="100%"&gt;
        &lt;mx:Box id="box1"
                backgroundColor="haloGreen"
                width="100%"
                height="100%"
                minWidth="100" /&gt;
        &lt;mx:Box id="box2"
                backgroundColor="haloBlue"
                width="100%"
                height="100%"
                minWidth="100" /&gt;
    &lt;/mx:HDividedBox&gt;

&lt;/mx:Application&gt;
</pre>
<p>Or, you can set the <code>horizontalGap</code> style using ActionScript, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/HDividedBox_horizontalGap_test/bin/srcview/source/main3.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/09/22/setting-the-padding-between-children-in-a-dividedbox-in-flex/ --&gt;
&lt;mx:Application name="HDividedBox_horizontalGap_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.events.SliderEvent;

            private function slider_change(evt:SliderEvent):void {
                dividedBox.setStyle("horizontalGap", evt.value);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="horizontalGap:"
                    direction="horizontal"&gt;
                &lt;mx:HSlider id="slider"
                        minimum="6"
                        maximum="20"
                        value="10"
                        snapInterval="1"
                        tickInterval="1"
                        liveDragging="true"
                        change="slider_change(event);" /&gt;
                &lt;mx:Label text="{slider.value}" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:HDividedBox id="dividedBox"
            width="100%"
            height="100%"&gt;
        &lt;mx:Box id="box1"
                backgroundColor="haloGreen"
                width="100%"
                height="100%"
                minWidth="100" /&gt;
        &lt;mx:Box id="box2"
                backgroundColor="haloBlue"
                width="100%"
                height="100%"
                minWidth="100" /&gt;
    &lt;/mx:HDividedBox&gt;

&lt;/mx:Application&gt;
</pre>
<p>Due to popular demand, here is the &#8220;same&#8221; example in a more ActionScript friendly format:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/HDividedBox_horizontalGap_test/bin/srcview/source/main4.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/09/22/setting-the-padding-between-children-in-a-dividedbox-in-flex/ --&gt;
&lt;mx:Application name="HDividedBox_horizontalGap_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"
        initialize="init();"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.containers.ApplicationControlBar;
            import mx.containers.Box;
            import mx.containers.Form;
            import mx.containers.FormItem;
            import mx.containers.FormItemDirection;
            import mx.containers.HDividedBox;
            import mx.controls.HSlider;
            import mx.controls.Label;
            import mx.events.SliderEvent;

            private var slider:HSlider;
            private var dividedBox:HDividedBox;
            private var box1:Box;
            private var box2:Box;
            private var lbl:Label;

            private function init():void {
                slider = new HSlider();
                slider.minimum = 6;
                slider.maximum = 20;
                slider.value = 10;
                slider.snapInterval = 1;
                slider.tickInterval = 1;
                slider.liveDragging = true;
                slider.addEventListener(SliderEvent.CHANGE, slider_change);

                lbl = new Label();

                var formItem:FormItem = new FormItem();
                formItem.label = "horizontalGap:";
                formItem.direction = FormItemDirection.HORIZONTAL;
                formItem.addChild(slider);
                formItem.addChild(lbl);

                var form:Form = new Form();
                form.styleName = "plain";
                form.addChild(formItem);

                var appControlBar:ApplicationControlBar;
                appControlBar = new ApplicationControlBar();
                appControlBar.dock = true;
                appControlBar.addChild(form);
                addChildAt(appControlBar, 0);

                box1 = new Box();
                box1.percentWidth = 100;
                box1.percentHeight = 100;
                box1.minWidth = 100;
                box1.setStyle("backgroundColor", "haloGreen");

                box2 = new Box();
                box2.percentWidth = 100;
                box2.percentHeight = 100;
                box2.minWidth = 100;
                box2.setStyle("backgroundColor", "haloBlue");

                dividedBox = new HDividedBox();
                dividedBox.percentWidth = 100;
                dividedBox.percentHeight = 100;
                dividedBox.addChild(box1);
                dividedBox.addChild(box2);
                addChild(dividedBox);
            }

            private function slider_change(evt:SliderEvent):void {
                dividedBox.setStyle("horizontalGap", evt.value);
                lbl.text = evt.value.toString();
            }
        ]]&gt;
    &lt;/mx:Script&gt;

&lt;/mx:Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting the padding between children in a DividedBox in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/09/22/setting-the-padding-between-children-in-a-dividedbox-in-flex/',contentID: 'post-803',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'horizontalGap',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/09/22/setting-the-padding-between-children-in-a-dividedbox-in-flex/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Customizing the divider skin on a DividedBox container in Flex</title>
		<link>http://blog.flexexamples.com/2008/09/18/customizing-the-divider-skin-on-a-dividedbox-container-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/09/18/customizing-the-divider-skin-on-a-dividedbox-container-in-flex/#comments</comments>
		<pubDate>Fri, 19 Sep 2008 06:14:14 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[HDividedBox]]></category>
		<category><![CDATA[VDividedBox]]></category>
		<category><![CDATA[dividerSkin]]></category>
		<category><![CDATA[horizontalGap]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/09/18/customizing-the-divider-skin-on-a-dividedbox-container-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can customize the divider skin on a Flex HDividedBox or VDividedBox container by setting the dividerSkin style.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/HDividedBox_dividerSkin_test/bin/srcview/source/main.mxml.html">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/09/18/customizing-the-divider-skin-on-a-dividedbox-container-in-flex/ --&#62; &#60;mx:Application name="HDividedBox_dividerSkin_test" xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:HDividedBox id="dividedBox" dividerSkin="@Embed('assets/DividedBox.png')" horizontalGap="24" width="100%" height="100%"&#62; &#60;mx:Box id="box1" backgroundColor="haloGreen" width="100%" [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can customize the divider skin on a Flex HDividedBox or VDividedBox container by setting the <code>dividerSkin</code> style.</p>
<p>Full code after the jump.</p>
<p><span id="more-802"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/HDividedBox_dividerSkin_test/bin/srcview/source/main.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/09/18/customizing-the-divider-skin-on-a-dividedbox-container-in-flex/ --&gt;
&lt;mx:Application name="HDividedBox_dividerSkin_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:HDividedBox id="dividedBox"
            dividerSkin="@Embed('assets/DividedBox.png')"
            horizontalGap="24"
            width="100%"
            height="100%"&gt;
        &lt;mx:Box id="box1"
                backgroundColor="haloGreen"
                width="100%"
                height="100%"
                minWidth="100" /&gt;
        &lt;mx:Box id="box2"
                backgroundColor="haloBlue"
                width="100%"
                height="100%"
                minWidth="100" /&gt;
    &lt;/mx:HDividedBox&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/HDividedBox_dividerSkin_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/HDividedBox_dividerSkin_test/bin/main.html" width="100%" height="200"></iframe></p>
<p>You can also set the <code>dividerSkin</code> style in an external .CSS file or &lt;mx:Style /&gt; block, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/HDividedBox_dividerSkin_test/bin/srcview/source/main2.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/09/18/customizing-the-divider-skin-on-a-dividedbox-container-in-flex/ --&gt;
&lt;mx:Application name="HDividedBox_dividerSkin_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        HDividedBox {
            dividerSkin: Embed("assets/DividedBox.png");
            horizontalGap: 24;
        }
    &lt;/mx:Style&gt;

    &lt;mx:HDividedBox id="dividedBox"
            width="100%"
            height="100%"&gt;
        &lt;mx:Box id="box1"
                backgroundColor="haloGreen"
                width="100%"
                height="100%"
                minWidth="100" /&gt;
        &lt;mx:Box id="box2"
                backgroundColor="haloBlue"
                width="100%"
                height="100%"
                minWidth="100" /&gt;
    &lt;/mx:HDividedBox&gt;

&lt;/mx:Application&gt;
</pre>
<p>Or, you can set the <code>dividerSkin</code> style using ActionScript, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/HDividedBox_dividerSkin_test/bin/srcview/source/main3.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/09/18/customizing-the-divider-skin-on-a-dividedbox-container-in-flex/ --&gt;
&lt;mx:Application name="HDividedBox_dividerSkin_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"
        initialize="init();"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            [Embed("assets/DividedBox.png")]
            private const customDividerSkin:Class;

            private function init():void {
                dividedBox.setStyle("dividerSkin", customDividerSkin);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:HDividedBox id="dividedBox"
            horizontalGap="24"
            width="100%"
            height="100%"&gt;
        &lt;mx:Box id="box1"
                backgroundColor="haloGreen"
                width="100%"
                height="100%"
                minWidth="100" /&gt;
        &lt;mx:Box id="box2"
                backgroundColor="haloBlue"
                width="100%"
                height="100%"
                minWidth="100" /&gt;
    &lt;/mx:HDividedBox&gt;

&lt;/mx:Application&gt;
</pre>
<p>Due to popular demand, here is the &#8220;same&#8221; example in a more ActionScript friendly format:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/HDividedBox_dividerSkin_test/bin/srcview/source/main4.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/09/18/customizing-the-divider-skin-on-a-dividedbox-container-in-flex/ --&gt;
&lt;mx:Application name="HDividedBox_dividerSkin_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"
        initialize="init();"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.containers.Box;
            import mx.containers.HDividedBox;

            [Embed("assets/DividedBox.png")]
            private const customDividerSkin:Class;

            private var dividedBox:HDividedBox;
            private var box1:Box;
            private var box2:Box;

            private function init():void {
                box1 = new Box();
                box1.percentWidth = 100;
                box1.percentHeight = 100;
                box1.minWidth = 100;
                box1.setStyle("backgroundColor", "haloGreen");

                box2 = new Box();
                box2.percentWidth = 100;
                box2.percentHeight = 100;
                box2.minWidth = 100;
                box2.setStyle("backgroundColor", "haloBlue");

                dividedBox = new HDividedBox();
                dividedBox.percentWidth = 100;
                dividedBox.percentHeight = 100;
                dividedBox.setStyle("dividerSkin", customDividerSkin);
                dividedBox.setStyle("horizontalGap", 24);
                dividedBox.addChild(box1);
                dividedBox.addChild(box2);
                addChild(dividedBox);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

&lt;/mx:Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Customizing the divider skin on a DividedBox container in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/09/18/customizing-the-divider-skin-on-a-dividedbox-container-in-flex/',contentID: 'post-802',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'dividerSkin,horizontalGap',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/09/18/customizing-the-divider-skin-on-a-dividedbox-container-in-flex/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Setting a custom divider color on the DividedBox container in Flex</title>
		<link>http://blog.flexexamples.com/2008/09/17/setting-a-custom-divider-color-on-the-dividedbox-container-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/09/17/setting-a-custom-divider-color-on-the-dividedbox-container-in-flex/#comments</comments>
		<pubDate>Thu, 18 Sep 2008 06:03:52 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[HDividedBox]]></category>
		<category><![CDATA[VDividedBox]]></category>
		<category><![CDATA[dividerColor]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/09/17/setting-a-custom-divider-color-on-the-dividedbox-container-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can set a custom divider color on a Flex DividedBox container (HDividedBox or VDividedBox) by setting the dividerColor style.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/HDividedBox_dividerColor_test/bin/srcview/source/main.mxml.html">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/09/17/setting-a-custom-divider-color-on-the-dividedbox-container-in-flex/ --&#62; &#60;mx:Application name="HDividedBox_dividerColor_test" xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:ApplicationControlBar dock="true"&#62; &#60;mx:Form styleName="plain"&#62; &#60;mx:FormItem label="dividerColor:"&#62; &#60;mx:ColorPicker id="colorPicker" [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set a custom divider color on a Flex DividedBox container (HDividedBox or VDividedBox) by setting the <code>dividerColor</code> style.</p>
<p>Full code after the jump.</p>
<p><span id="more-801"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/HDividedBox_dividerColor_test/bin/srcview/source/main.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/09/17/setting-a-custom-divider-color-on-the-dividedbox-container-in-flex/ --&gt;
&lt;mx:Application name="HDividedBox_dividerColor_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="dividerColor:"&gt;
                &lt;mx:ColorPicker id="colorPicker" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:HDividedBox id="dividedBox"
            dividerColor="{colorPicker.selectedColor}"
            width="100%"
            height="100%"&gt;
        &lt;mx:Box id="box1"
                backgroundColor="haloGreen"
                width="100%"
                height="100%"
                minWidth="100" /&gt;
        &lt;mx:Box id="box2"
                backgroundColor="haloBlue"
                width="100%"
                height="100%"
                minWidth="100" /&gt;
    &lt;/mx:HDividedBox&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/HDividedBox_dividerColor_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/HDividedBox_dividerColor_test/bin/main.html" width="100%" height="250"></iframe></p>
<p>You can also set the <code>dividerColor</code> style in an external .CSS file or &lt;mx:Style /&gt; block, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/HDividedBox_dividerColor_test/bin/srcview/source/main2.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/09/17/setting-a-custom-divider-color-on-the-dividedbox-container-in-flex/ --&gt;
&lt;mx:Application name="HDividedBox_dividerColor_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        HDividedBox {
            dividerColor: red;
        }
    &lt;/mx:Style&gt;

    &lt;mx:HDividedBox id="dividedBox"
            width="100%"
            height="100%"&gt;
        &lt;mx:Box id="box1"
                backgroundColor="haloGreen"
                width="100%"
                height="100%"
                minWidth="100" /&gt;
        &lt;mx:Box id="box2"
                backgroundColor="haloBlue"
                width="100%"
                height="100%"
                minWidth="100" /&gt;
    &lt;/mx:HDividedBox&gt;

&lt;/mx:Application&gt;
</pre>
<p>Or, you can set the <code>dividerColor</code> style using ActionScript, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/HDividedBox_dividerColor_test/bin/srcview/source/main3.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/09/17/setting-a-custom-divider-color-on-the-dividedbox-container-in-flex/ --&gt;
&lt;mx:Application name="HDividedBox_dividerColor_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.events.ColorPickerEvent;

            private function colorPicker_change(evt:ColorPickerEvent):void {
                dividedBox.setStyle("dividerColor", evt.color);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="dividerColor:"&gt;
                &lt;mx:ColorPicker id="colorPicker"
                        change="colorPicker_change(event);" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:HDividedBox id="dividedBox"
            width="100%"
            height="100%"&gt;
        &lt;mx:Box id="box1"
                backgroundColor="haloGreen"
                width="100%"
                height="100%"
                minWidth="100" /&gt;
        &lt;mx:Box id="box2"
                backgroundColor="haloBlue"
                width="100%"
                height="100%"
                minWidth="100" /&gt;
    &lt;/mx:HDividedBox&gt;

&lt;/mx:Application&gt;
</pre>
<p>Due to popular demand, here is the &#8220;same&#8221; example in a more ActionScript friendly format:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/HDividedBox_dividerColor_test/bin/srcview/source/main4.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/09/17/setting-a-custom-divider-color-on-the-dividedbox-container-in-flex/ --&gt;
&lt;mx:Application name="HDividedBox_dividerColor_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"
        initialize="init();"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.containers.ApplicationControlBar;
            import mx.containers.Box;
            import mx.containers.Form;
            import mx.containers.FormItem;
            import mx.containers.HDividedBox;
            import mx.controls.ColorPicker;
            import mx.events.ColorPickerEvent;

            private var colorPicker:ColorPicker;
            private var box1:Box;
            private var box2:Box;
            private var dividedBox:HDividedBox;

            private function init():void {
                colorPicker = new ColorPicker();
                colorPicker.addEventListener(ColorPickerEvent.CHANGE,
                            colorPicker_change);

                var formItem:FormItem = new FormItem();
                formItem.label = "dividerColor:";
                formItem.addChild(colorPicker);

                var form:Form = new Form();
                form.styleName = "plain";
                form.addChild(formItem);

                var appControlBar:ApplicationControlBar;
                appControlBar = new ApplicationControlBar();
                appControlBar.dock = true;
                appControlBar.addChild(form);
                addChildAt(appControlBar, 0);

                box1 = new Box();
                box1.percentWidth = 100;
                box1.percentHeight = 100;
                box1.minWidth = 100;
                box1.setStyle("backgroundColor", "haloGreen");

                box2 = new Box();
                box2.percentWidth = 100;
                box2.percentHeight = 100;
                box2.minWidth = 100;
                box2.setStyle("backgroundColor", "haloBlue");

                dividedBox = new HDividedBox();
                dividedBox.percentWidth = 100;
                dividedBox.percentHeight = 100;
                dividedBox.addChild(box1);
                dividedBox.addChild(box2);
                addChild(dividedBox);
            }

            private function colorPicker_change(evt:ColorPickerEvent):void {
                dividedBox.setStyle("dividerColor", evt.color);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

&lt;/mx:Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting a custom divider color on the DividedBox container in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/09/17/setting-a-custom-divider-color-on-the-dividedbox-container-in-flex/',contentID: 'post-801',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'dividerColor',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/09/17/setting-a-custom-divider-color-on-the-dividedbox-container-in-flex/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Programmatically resizing a Flex HDividedBox container</title>
		<link>http://blog.flexexamples.com/2007/10/09/programmatically-resizing-a-flex-hdividedbox-container/</link>
		<comments>http://blog.flexexamples.com/2007/10/09/programmatically-resizing-a-flex-hdividedbox-container/#comments</comments>
		<pubDate>Wed, 10 Oct 2007 04:15:30 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[HDividedBox]]></category>
		<category><![CDATA[VDividedBox]]></category>
		<category><![CDATA[getDividerAt()]]></category>
		<category><![CDATA[moveDivider()]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/10/09/programmatically-resizing-a-flex-hdividedbox-container/</guid>
		<description><![CDATA[<p>The following example shows how you can programmatically resize an HDividedBox container in Flex using the moveDivider() and getDividerAt() methods.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/HDividedBox_moveDivider_test/main.mxml">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2007/10/09/programmatically-resizing-a-flex-hdividedbox-container/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:ApplicationControlBar dock="true"&#62; &#60;!-- Move the divider 20 pixels to the left for as long [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can programmatically resize an HDividedBox container in Flex using the <code>moveDivider()</code> and <code>getDividerAt()</code> methods.</p>
<p>Full code after the jump.</p>
<p><span id="more-226"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/HDividedBox_moveDivider_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2007/10/09/programmatically-resizing-a-flex-hdividedbox-container/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;!-- Move the divider 20 pixels to the left for as long as the
             Button control is pressed (autoRepeat=true). --&gt;
        &lt;mx:Button label="x-=20"
                autoRepeat="true"
                buttonDown="hdivbox.moveDivider(0, -20);" /&gt;
        &lt;!-- Move the divider 20 pixels to the right for as long as the
             Button control is pressed (autoRepeat=true). --&gt;
        &lt;mx:Button label="x+=20"
                autoRepeat="true"
                buttonDown="hdivbox.moveDivider(0, 20);" /&gt;

        &lt;mx:Spacer width="50" /&gt;

        &lt;!-- Move the divider to 100 pixels from the left. --&gt;
        &lt;mx:Button label="x=100"
                click="hdivbox.getDividerAt(0).x = 100;" /&gt;
        &lt;!-- Move the divider to 420 pixels from the left. --&gt;
        &lt;mx:Button label="x=420"
                click="hdivbox.getDividerAt(0).x = 420;" /&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:HDividedBox id="hdivbox" width="100%" height="100%"&gt;
        &lt;mx:VBox backgroundColor="haloGreen" width="100%" height="100%"&gt;
            &lt;!-- children --&gt;
        &lt;/mx:VBox&gt;
        &lt;mx:VBox backgroundColor="haloBlue" width="100%" height="100%"&gt;
            &lt;!-- children --&gt;
        &lt;/mx:VBox&gt;
    &lt;/mx:HDividedBox&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/HDividedBox_moveDivider_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/HDividedBox_moveDivider_test/bin/main.html" width="100%" height="350"></iframe></p>
<p>In the previous example, the <code>moveDivider()</code> method is used to move the divider relative to its current position. So, calling <code>moveDivider(0, 20)</code> moves the first (and only) divider 20 pixels to the right. To move the divider 20 pixels to the right, you&#8217;d pass a negative value for the second parameter, like so:</p>
<pre class="code">moveDivider(0, -20)</pre>
<p>To set the divider to a specific point, you can use the <code>getDividerAt()</code> method and set the divider&#8217;s <code>x</code> property (for a horizontal divided box, if you were using a vertical divided box you would set the <code>y</code> property instead). So again in the previous example, you would use the following code to set the first divider to 100 pixels from the left edge:</p>
<pre class="code">hdivbox.getDividerAt(0).x = 100;</pre>
<p>If you wanted to force the nested VBox containers to have a minimum or maximum width, simply set the <code>minWidth</code> and/or <code>maxWidth</code> properties, as seen in the following snippet:</p>
<pre class="code">
&lt;mx:VBox backgroundColor=&quot;haloGreen&quot;
        width=&quot;100%&quot;
        height=&quot;100%&quot;
        <span style="color:red;">minWidth=&quot;50&quot;
        maxWidth=&quot;250&quot;</span>&gt;
    &lt;!-- children --&gt;
&lt;/mx:VBox&gt;
</pre>
<p>Now when you resize the HDividedBox container&#8217;s divider, the green VBox container will be at least 50 pixels wide and at most 250 pixels wide.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Programmatically resizing a Flex HDividedBox container on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/10/09/programmatically-resizing-a-flex-hdividedbox-container/',contentID: 'post-226',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'getDividerAt(),moveDivider()',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/2007/10/09/programmatically-resizing-a-flex-hdividedbox-container/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
	</channel>
</rss>

