<?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; direction</title>
	<atom:link href="http://blog.flexexamples.com/tag/direction/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 tab stops on a Spark RichText control in Flex 4</title>
		<link>http://blog.flexexamples.com/2009/08/26/setting-tab-stops-on-a-spark-richtext-control-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2009/08/26/setting-tab-stops-on-a-spark-richtext-control-in-flex-4/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 18:53:10 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta1]]></category>
		<category><![CDATA[RichText (Spark)]]></category>
		<category><![CDATA[direction]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[tab]]></category>
		<category><![CDATA[tabStops]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=1754</guid>
		<description><![CDATA[<p>The following example shows how you can use tab stops on a Spark RichText primitive in Flex 4 by setting the tabStops style.</p> <p>Full code after the jump.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2009/08/26/setting-tab-stops-on-a-spark-richtext-control-in-flex-4/ --&#62; &#60;s:Application name=&#34;Spark_RichText_tabStops_test&#34; xmlns:fx=&#34;http://ns.adobe.com/mxml/2009&#34; xmlns:s=&#34;library://ns.adobe.com/flex/spark&#34; xmlns:mx=&#34;library://ns.adobe.com/flex/halo&#34;&#62; &#60;s:controlBarContent&#62; &#60;mx:Form&#62; &#60;mx:FormItem label=&#34;direction:&#34;&#62; &#60;s:DropDownList id=&#34;dropDownList&#34; requireSelection=&#34;true&#34;&#62; &#60;s:dataProvider&#62; &#60;s:ArrayList source=&#34;[ltr,rtl]&#34; /&#62; &#60;/s:dataProvider&#62; &#60;/s:DropDownList&#62; &#60;/mx:FormItem&#62; &#60;/mx:Form&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can use tab stops on a Spark RichText primitive in Flex 4 by setting the <code>tabStops</code> style.</p>
<p>Full code after the jump.</p>
<p><span id="more-1754"></span></p>
<p class="alert">The following example(s) require Flash Player 10 and the Adobe Flex 4 SDK. To download the Adobe Flash Builder 4 trial, see <a href="http://bit.ly/crThlI">http://www.adobe.com/products/flex/</a>. To download the latest nightly build of the Flex 4 SDK, see <a href="http://bit.ly/Flex4SDK">http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4</a>.<br/><strong>For more information on getting started with Flex 4 and Flash Builder 4, see the official <a href="http://bit.ly/dCkecm">Adobe Flex Team blog</a>.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2009/08/26/setting-tab-stops-on-a-spark-richtext-control-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;Spark_RichText_tabStops_test&quot;</span></span>
<span style="color: #000000;">        xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span> </span>
<span style="color: #000000;">        xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span> </span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/halo&quot;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:controlBarContent</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Form</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:FormItem</span> label=<span style="color: #ff0000;">&quot;direction:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:DropDownList</span> id=<span style="color: #ff0000;">&quot;dropDownList&quot;</span> requireSelection=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:ArrayList</span> source=<span style="color: #ff0000;">&quot;[ltr,rtl]&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:DropDownList</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Form</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:controlBarContent</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Panel</span> title=<span style="color: #ff0000;">&quot;Spark RichText tabStops/tab test&quot;</span></span>
<span style="color: #000000;">            horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:VRule</span> x=<span style="color: #ff0000;">&quot;100&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:VRule</span> x=<span style="color: #ff0000;">&quot;200&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:VRule</span> x=<span style="color: #ff0000;">&quot;300&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:RichText</span> id=<span style="color: #ff0000;">&quot;richTxt&quot;</span></span>
<span style="color: #000000;">                direction=<span style="color: #ff0000;">&quot;{dropDownList.selectedItem}&quot;</span></span>
<span style="color: #000000;">                tabStops=<span style="color: #ff0000;">&quot;100 200 300&quot;</span></span>
<span style="color: #000000;">                paragraphSpaceAfter=<span style="color: #ff0000;">&quot;20&quot;</span></span>
<span style="color: #000000;">                width=<span style="color: #ff0000;">&quot;400&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:content</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:p</span> direction=<span style="color: #ff0000;">&quot;ltr&quot;</span> fontWeight=<span style="color: #ff0000;">&quot;bold&quot;</span><span style="color: #7400FF;">&gt;</span></span>0px<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:tab</span><span style="color: #7400FF;">/&gt;</span></span>100px<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:tab</span><span style="color: #7400FF;">/&gt;</span></span>200px<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:tab</span><span style="color: #7400FF;">/&gt;</span></span>300px<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:p</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:p</span><span style="color: #7400FF;">&gt;</span></span>Col 1<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:tab</span><span style="color: #7400FF;">/&gt;</span></span>Col 2<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:tab</span><span style="color: #7400FF;">/&gt;</span></span>Col 3<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:tab</span><span style="color: #7400FF;">/&gt;</span></span>Col 4<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:p</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:content</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:RichText</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Panel</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/spark/Spark_RichText_tabStops_test/bin/srcview/">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/spark/Spark_RichText_tabStops_test/bin/main.html" width="100%" height="350"></iframe></p>
<div span="googleAdsLeaderboard">
<script type="text/javascript"><!--
google_ad_client = "pub-3325829455487492";
/* 728x90, created 7/15/09 */
google_ad_slot = "6403511741";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<br />
</div>
<p>You can also set tabs in a RichText control by setting the <code>text</code> property and using \t, as seen in the following example:</p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2009/08/26/setting-tab-stops-on-a-spark-richtext-control-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;Spark_RichText_tabStops_test&quot;</span></span>
<span style="color: #000000;">        xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span style="color: #000000;">        xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/halo&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:controlBarContent</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Form</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:FormItem</span> label=<span style="color: #ff0000;">&quot;direction:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:DropDownList</span> id=<span style="color: #ff0000;">&quot;dropDownList&quot;</span> requireSelection=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:ArrayList</span> source=<span style="color: #ff0000;">&quot;[ltr,rtl]&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:DropDownList</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Form</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:controlBarContent</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Panel</span> title=<span style="color: #ff0000;">&quot;Spark RichText tabStops/tab test&quot;</span></span>
<span style="color: #000000;">            horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:VRule</span> x=<span style="color: #ff0000;">&quot;100&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:VRule</span> x=<span style="color: #ff0000;">&quot;200&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:VRule</span> x=<span style="color: #ff0000;">&quot;300&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:RichText</span> id=<span style="color: #ff0000;">&quot;richTxt&quot;</span></span>
<span style="color: #000000;">                text=<span style="color: #ff0000;">&quot;Col 1{'\t'}Col 2{'\t'}Col 3{'\t'}Col 4&quot;</span></span>
<span style="color: #000000;">                direction=<span style="color: #ff0000;">&quot;{dropDownList.selectedItem}&quot;</span></span>
<span style="color: #000000;">                tabStops=<span style="color: #ff0000;">&quot;100 200 300&quot;</span></span>
<span style="color: #000000;">                paragraphSpaceAfter=<span style="color: #ff0000;">&quot;20&quot;</span></span>
<span style="color: #000000;">                width=<span style="color: #ff0000;">&quot;400&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Panel</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>Due to popular demand, here is the &#8220;same&#8221; example in a more ActionScript friendly format:</p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2009/08/26/setting-tab-stops-on-a-spark-richtext-control-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;Spark_RichText_tabStops_test&quot;</span></span>
<span style="color: #000000;">        xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span style="color: #000000;">        xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/halo&quot;</span></span>
<span style="color: #000000;">        initialize=<span style="color: #ff0000;">&quot;init();&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;">&lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span></span>
<span style="color: #000000;">            import flashx.textLayout.formats.Direction;</span>
<span style="color: #000000;">            import mx.collections.ArrayList;</span>
<span style="color: #000000;">            import mx.containers.Form;</span>
<span style="color: #000000;">            import mx.containers.FormItem;</span>
<span style="color: #000000;">            import mx.controls.VRule;</span>
<span style="color: #000000;">            import mx.core.FlexGlobals;</span>
<span style="color: #000000;">            import spark.components.DropDownList;</span>
<span style="color: #000000;">            import spark.components.Panel;</span>
<span style="color: #000000;">            import spark.events.IndexChangeEvent;</span>
<span style="color: #000000;">            import spark.primitives.RichText;</span>
&nbsp;
<span style="color: #000000;">            private var dropDownList:DropDownList;</span>
<span style="color: #000000;">            private var pnl:Panel;</span>
<span style="color: #000000;">            private var richTxt:RichText;</span>
&nbsp;
<span style="color: #000000;">            private function init<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                dropDownList = new DropDownList<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dropDownList.dataProvider = new ArrayList<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#91;</span>Direction.LTR, Direction.RTL<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dropDownList.requireSelection = true;</span>
<span style="color: #000000;">                dropDownList.addEventListener<span style="color: #66cc66;">&#40;</span>IndexChangeEvent.CHANGE, dropDownList_change<span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                var formItem:FormItem = new FormItem<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                formItem.label = <span style="color: #ff0000;">&quot;direction:&quot;</span>;</span>
<span style="color: #000000;">                formItem.addElement<span style="color: #66cc66;">&#40;</span>dropDownList<span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                var form:Form = new Form<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                form.addElement<span style="color: #66cc66;">&#40;</span>formItem<span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                Application<span style="color: #66cc66;">&#40;</span>FlexGlobals.topLevelApplication<span style="color: #66cc66;">&#41;</span>.controlBarContent = <span style="color: #66cc66;">&#91;</span>form<span style="color: #66cc66;">&#93;</span>;</span>
&nbsp;
<span style="color: #000000;">                richTxt = new RichText<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                richTxt.text = <span style="color: #ff0000;">&quot;Col 1\tCol 2\tCol 3\tCol 4&quot;</span>;</span>
<span style="color: #000000;">                richTxt.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;tabStops&quot;</span>, <span style="color: #ff0000;">&quot;100 200 300&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                richTxt.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;paragraphSpaceAfter&quot;</span>, <span style="color: #cc66cc;">20</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                richTxt.width = <span style="color: #cc66cc;">400</span>;</span>
&nbsp;
<span style="color: #000000;">                var vRule1:VRule = new VRule<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                vRule1.x = <span style="color: #cc66cc;">100</span>;</span>
&nbsp;
<span style="color: #000000;">                var vRule2:VRule = new VRule<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                vRule2.x = <span style="color: #cc66cc;">200</span>;</span>
&nbsp;
<span style="color: #000000;">                var vRule3:VRule = new VRule<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                vRule3.x = <span style="color: #cc66cc;">300</span>;</span>
&nbsp;
<span style="color: #000000;">                pnl = new Panel<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                pnl.title = <span style="color: #ff0000;">&quot;Spark RichText tabStops/tab test&quot;</span>;</span>
<span style="color: #000000;">                pnl.horizontalCenter = <span style="color: #cc66cc;">0</span>;</span>
<span style="color: #000000;">                pnl.verticalCenter = <span style="color: #cc66cc;">0</span>;</span>
<span style="color: #000000;">                pnl.addElement<span style="color: #66cc66;">&#40;</span>vRule1<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                pnl.addElement<span style="color: #66cc66;">&#40;</span>vRule2<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                pnl.addElement<span style="color: #66cc66;">&#40;</span>vRule3<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                pnl.addElement<span style="color: #66cc66;">&#40;</span>richTxt<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                addElement<span style="color: #66cc66;">&#40;</span>pnl<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            protected function dropDownList_change<span style="color: #66cc66;">&#40;</span>evt:IndexChangeEvent<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                richTxt.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;direction&quot;</span>, dropDownList.selectedItem<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p class="alert">This entry is based on a beta version of the Flex 4 SDK and therefore is very likely to change as development of the Flex SDK continues. The API can (and will) change causing examples to possibly not compile in newer versions of the Flex 4 SDK.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting tab stops on a Spark RichText control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/08/26/setting-tab-stops-on-a-spark-richtext-control-in-flex-4/',contentID: 'post-1754',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'direction,Gumbo,tab,tabStops',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/2009/08/26/setting-tab-stops-on-a-spark-richtext-control-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Setting text alignment on a Spark TextArea control in Flex 4</title>
		<link>http://blog.flexexamples.com/2008/10/22/setting-text-alignment-on-an-fxtextarea-control-in-flex-gumbo/</link>
		<comments>http://blog.flexexamples.com/2008/10/22/setting-text-alignment-on-an-fxtextarea-control-in-flex-gumbo/#comments</comments>
		<pubDate>Thu, 23 Oct 2008 05:31:14 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta]]></category>
		<category><![CDATA[FxTextArea]]></category>
		<category><![CDATA[direction]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[textAlign]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/10/22/setting-text-alignment-on-an-fxtextarea-control-in-flex-gumbo/</guid>
		<description><![CDATA[<p>The following example shows how you can set the text alignment and text direction in a Spark TextArea control in Flex 4 by setting the textAlign and direction styles.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/FxTextArea_textAlign_test/bin/srcview/source/main_4_0_0_3803.mxml.html">View MXML</a></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2008/10/22/setting-text-alignment-on-an-fxtextarea-control-in-flex-gumbo/ --&#62; &#60;Application name=&#34;FxTextArea_textAlign_test&#34; xmlns=&#34;http://ns.adobe.com/mxml/2009&#34; layout=&#34;vertical&#34; verticalAlign=&#34;middle&#34; backgroundColor=&#34;white&#34;&#62; &#60;Script&#62; &#60;![CDATA[ import flashx.textLayout.formats.Direction; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set the text alignment and text direction in a Spark TextArea control in Flex 4 by setting the <code>textAlign</code> and <code>direction</code> styles.</p>
<p>Full code after the jump.</p>
<p><span id="more-839"></span></p>
<p class="alert">The following example(s) require Flash Player 10 and the Adobe Flex 4 SDK. To download the Adobe Flash Builder 4 trial, see <a href="http://bit.ly/crThlI">http://www.adobe.com/products/flex/</a>. To download the latest nightly build of the Flex 4 SDK, see <a href="http://bit.ly/Flex4SDK">http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4</a>.<br/><strong>For more information on getting started with Flex 4 and Flash Builder 4, see the official <a href="http://bit.ly/dCkecm">Adobe Flex Team blog</a>.</strong></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/FxTextArea_textAlign_test/bin/srcview/source/main_4_0_0_3803.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;!-- http://blog.flexexamples.com/2008/10/22/setting-text-alignment-on-an-fxtextarea-control-in-flex-gumbo/ --&gt;
&lt;Application name=&quot;FxTextArea_textAlign_test&quot;
        xmlns=&quot;http://ns.adobe.com/mxml/2009&quot;
        layout=&quot;vertical&quot;
        verticalAlign=&quot;middle&quot;
        backgroundColor=&quot;white&quot;&gt;

    &lt;Script&gt;
        &lt;![CDATA[
            import flashx.textLayout.formats.Direction;
            import flashx.textLayout.formats.TextAlign;
        ]]&gt;
    &lt;/Script&gt;

    &lt;Declarations&gt;
        &lt;Array id=&quot;textAlignDP&quot;&gt;
            &lt;String&gt;{TextAlign.START}&lt;/String&gt;
            &lt;String&gt;{TextAlign.LEFT}&lt;/String&gt;
            &lt;String&gt;{TextAlign.CENTER}&lt;/String&gt;
            &lt;String&gt;{TextAlign.RIGHT}&lt;/String&gt;
            &lt;String&gt;{TextAlign.END}&lt;/String&gt;
            &lt;String&gt;{TextAlign.JUSTIFY}&lt;/String&gt;
        &lt;/Array&gt;
        &lt;Array id=&quot;directionDP&quot;&gt;
            &lt;String&gt;{Direction.LTR}&lt;/String&gt;
            &lt;String&gt;{Direction.RTL}&lt;/String&gt;
        &lt;/Array&gt;
        &lt;String id=&quot;lorem&quot; source=&quot;data/lorem.html&quot; /&gt;
    &lt;/Declarations&gt;

    &lt;ApplicationControlBar dock=&quot;true&quot;&gt;
        &lt;Form styleName=&quot;plain&quot;&gt;
            &lt;FormItem label=&quot;textAlign:&quot;&gt;
                &lt;ComboBox id=&quot;textAlignComboBox&quot;
                        dataProvider=&quot;{textAlignDP}&quot; /&gt;
            &lt;/FormItem&gt;
            &lt;FormItem label=&quot;direction:&quot;&gt;
                &lt;ComboBox id=&quot;directionComboBox&quot;
                        dataProvider=&quot;{directionDP}&quot; /&gt;
            &lt;/FormItem&gt;
        &lt;/Form&gt;
    &lt;/ApplicationControlBar&gt;

    &lt;FxTextArea id=&quot;fxTextArea&quot;
            content=&quot;{lorem}&quot;
            textAlign=&quot;{textAlignComboBox.selectedItem}&quot;
            direction=&quot;{directionComboBox.selectedItem}&quot;
            widthInChars=&quot;80&quot;
            heightInLines=&quot;25&quot;
            marginTop=&quot;20&quot; /&gt;

&lt;/Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/FxTextArea_textAlign_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/FxTextArea_textAlign_test/bin/main_4_0_0_3803.html" width="100%" height="500"></iframe></p>
<p>You can also set the <code>textAlign</code> and <code>direction</code> styles 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/FxTextArea_textAlign_test/bin/srcview/source/main2_4_0_0_3803.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;!-- http://blog.flexexamples.com/2008/10/22/setting-text-alignment-on-an-fxtextarea-control-in-flex-gumbo/ --&gt;
&lt;Application name=&quot;FxTextArea_textAlign_test&quot;
        xmlns=&quot;http://ns.adobe.com/mxml/2009&quot;
        layout=&quot;vertical&quot;
        verticalAlign=&quot;middle&quot;
        backgroundColor=&quot;white&quot;&gt;

    &lt;Style&gt;
        FxTextArea {
            textAlign: &quot;justify&quot;;
            direction: &quot;rtl&quot;;
            marginTop: 20;
        }
    &lt;/Style&gt;

    &lt;Declarations&gt;
        &lt;String id=&quot;lorem&quot; source=&quot;data/lorem.html&quot; /&gt;
    &lt;/Declarations&gt;

    &lt;FxTextArea id=&quot;fxTextArea&quot;
            content=&quot;{lorem}&quot;
            widthInChars=&quot;80&quot;
            heightInLines=&quot;25&quot; /&gt;

&lt;/Application&gt;
</pre>
<p>Or, you can set the <code>textAlign</code> and <code>direction</code> styles using ActionScript, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/FxTextArea_textAlign_test/bin/srcview/source/main3_4_0_0_3803.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;!-- http://blog.flexexamples.com/2008/10/22/setting-text-alignment-on-an-fxtextarea-control-in-flex-gumbo/ --&gt;
&lt;Application name=&quot;FxTextArea_textAlign_test&quot;
        xmlns=&quot;http://ns.adobe.com/mxml/2009&quot;
        layout=&quot;vertical&quot;
        verticalAlign=&quot;middle&quot;
        backgroundColor=&quot;white&quot;&gt;

    &lt;Script&gt;
        &lt;![CDATA[
            import flashx.textLayout.formats.Direction;
            import flashx.textLayout.formats.TextAlign;
            import mx.events.ListEvent;

            private function textAlignComboBox_change(evt:ListEvent):void {
                var value:String = evt.currentTarget.selectedItem;
                fxTextArea.setStyle(&quot;textAlign&quot;, value);
            }

            private function directionComboBox_change(evt:ListEvent):void {
                var value:String = evt.currentTarget.selectedItem;
                fxTextArea.setStyle(&quot;direction&quot;, value);
            }
        ]]&gt;
    &lt;/Script&gt;

    &lt;Declarations&gt;
        &lt;Array id=&quot;textAlignDP&quot;&gt;
            &lt;String&gt;{TextAlign.START}&lt;/String&gt;
            &lt;String&gt;{TextAlign.LEFT}&lt;/String&gt;
            &lt;String&gt;{TextAlign.CENTER}&lt;/String&gt;
            &lt;String&gt;{TextAlign.RIGHT}&lt;/String&gt;
            &lt;String&gt;{TextAlign.END}&lt;/String&gt;
            &lt;String&gt;{TextAlign.JUSTIFY}&lt;/String&gt;
        &lt;/Array&gt;
        &lt;Array id=&quot;directionDP&quot;&gt;
            &lt;String&gt;{Direction.LTR}&lt;/String&gt;
            &lt;String&gt;{Direction.RTL}&lt;/String&gt;
        &lt;/Array&gt;
        &lt;String id=&quot;lorem&quot; source=&quot;data/lorem.html&quot; /&gt;
    &lt;/Declarations&gt;

    &lt;ApplicationControlBar dock=&quot;true&quot;&gt;
        &lt;Form styleName=&quot;plain&quot;&gt;
            &lt;FormItem label=&quot;textAlign:&quot;&gt;
                &lt;ComboBox id=&quot;textAlignComboBox&quot;
                        dataProvider=&quot;{textAlignDP}&quot;
                        change=&quot;textAlignComboBox_change(event);&quot; /&gt;
            &lt;/FormItem&gt;
            &lt;FormItem label=&quot;direction:&quot;&gt;
                &lt;ComboBox id=&quot;directionComboBox&quot;
                        dataProvider=&quot;{directionDP}&quot;
                        change=&quot;textAlignComboBox_change(event)&quot; /&gt;
            &lt;/FormItem&gt;
        &lt;/Form&gt;
    &lt;/ApplicationControlBar&gt;

    &lt;FxTextArea id=&quot;fxTextArea&quot;
            content=&quot;{lorem}&quot;
            widthInChars=&quot;80&quot;
            heightInLines=&quot;25&quot;
            marginTop=&quot;20&quot; /&gt;

&lt;/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/FxTextArea_textAlign_test/bin/srcview/source/main4_4_0_0_3803.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;!-- http://blog.flexexamples.com/2008/10/22/setting-text-alignment-on-an-fxtextarea-control-in-flex-gumbo/ --&gt;
&lt;Application name=&quot;FxTextArea_textAlign_test&quot;
        xmlns=&quot;http://ns.adobe.com/mxml/2009&quot;
        layout=&quot;vertical&quot;
        verticalAlign=&quot;middle&quot;
        backgroundColor=&quot;white&quot;
        initialize=&quot;init();&quot;&gt;

    &lt;Declarations&gt;
        &lt;String id=&quot;lorem&quot; source=&quot;data/lorem.html&quot; /&gt;
    &lt;/Declarations&gt;

    &lt;Script&gt;
        &lt;![CDATA[
            import flashx.textLayout.formats.Direction;
            import flashx.textLayout.formats.TextAlign;
            import mx.events.ListEvent;
            import mx.controls.ComboBox;
            import mx.components.FxTextArea;
            import mx.containers.Form;
            import mx.containers.FormItem;
            import mx.containers.ApplicationControlBar;

            private var textAlignDP:Array;
            private var directionDP:Array;
            private var textAlignComboBox:ComboBox;
            private var directionComboBox:ComboBox;
            private var fxTextArea:FxTextArea;

            private function init():void {
                textAlignDP = [];
                textAlignDP.push(TextAlign.START);
                textAlignDP.push(TextAlign.LEFT);
                textAlignDP.push(TextAlign.CENTER);
                textAlignDP.push(TextAlign.RIGHT);
                textAlignDP.push(TextAlign.END);
                textAlignDP.push(TextAlign.JUSTIFY);

                directionDP = [];
                directionDP.push(Direction.LTR);
                directionDP.push(Direction.RTL);

                textAlignComboBox = new ComboBox();
                textAlignComboBox.dataProvider = textAlignDP;
                textAlignComboBox.addEventListener(ListEvent.CHANGE,
                            textAlignComboBox_change);

                directionComboBox = new ComboBox();
                directionComboBox.dataProvider = directionDP;
                directionComboBox.addEventListener(ListEvent.CHANGE,
                            directionComboBox_change);

                var formItem1:FormItem = new FormItem();
                formItem1.label = &quot;textAlign:&quot;;
                formItem1.addChild(textAlignComboBox);

                var formItem2:FormItem = new FormItem();
                formItem2.label = &quot;direction:&quot;;
                formItem2.addChild(directionComboBox);

                var form:Form = new Form();
                form.styleName = &quot;plain&quot;;
                form.addChild(formItem1);
                form.addChild(formItem2);

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

                fxTextArea = new FxTextArea();
                fxTextArea.content = lorem;
                fxTextArea.widthInChars = 80;
                fxTextArea.heightInLines = 25;
                fxTextArea.setStyle(&quot;marginTop&quot;, 20);
                addChild(fxTextArea);
            }

            private function textAlignComboBox_change(evt:ListEvent):void {
                var value:String = evt.currentTarget.selectedItem;
                fxTextArea.setStyle(&quot;textAlign&quot;, value);
            }

            private function directionComboBox_change(evt:ListEvent):void {
                var value:String = evt.currentTarget.selectedItem;
                fxTextArea.setStyle(&quot;direction&quot;, value);
            }
        ]]&gt;
    &lt;/Script&gt;

&lt;/Application&gt;
</pre>
<p class="alert">This entry is based on a beta version of the Flex 4 SDK and therefore is very likely to change as development of the Flex SDK continues. The API can (and will) change causing examples to possibly not compile in newer versions of the Flex 4 SDK.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting text alignment on a Spark TextArea control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/10/22/setting-text-alignment-on-an-fxtextarea-control-in-flex-gumbo/',contentID: 'post-839',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'direction,Gumbo,textAlign',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/22/setting-text-alignment-on-an-fxtextarea-control-in-flex-gumbo/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Setting the button height on a ButtonBar control in Flex</title>
		<link>http://blog.flexexamples.com/2008/09/30/setting-the-button-height-on-a-buttonbar-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/09/30/setting-the-button-height-on-a-buttonbar-control-in-flex/#comments</comments>
		<pubDate>Wed, 01 Oct 2008 06:39:16 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[ButtonBar]]></category>
		<category><![CDATA[buttonHeight]]></category>
		<category><![CDATA[direction]]></category>
		<category><![CDATA[textAlign]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/09/30/setting-the-button-height-on-a-buttonbar-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can set the button height on a Flex ButtonBar control by setting the buttonHeight style.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/ButtonBar_buttonHeight_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/30/setting-the-button-height-on-a-buttonbar-control-in-flex/ --&#62; &#60;mx:Application name="ButtonBar_buttonHeight_test" xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:Style&#62; .buttonBarButtonStyles { textAlign: left; } &#60;/mx:Style&#62; &#60;mx:Array id="arr"&#62; &#60;mx:Object label="Red" icon="@Embed('assets/bullet_red.png')" [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set the button height on a Flex ButtonBar control by setting the <code>buttonHeight</code> style.</p>
<p>Full code after the jump.</p>
<p><span id="more-813"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/ButtonBar_buttonHeight_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/30/setting-the-button-height-on-a-buttonbar-control-in-flex/ --&gt;
&lt;mx:Application name="ButtonBar_buttonHeight_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        .buttonBarButtonStyles {
            textAlign: left;
        }
    &lt;/mx:Style&gt;

    &lt;mx:Array id="arr"&gt;
        &lt;mx:Object label="Red"
                icon="@Embed('assets/bullet_red.png')" /&gt;
        &lt;mx:Object label="Orange"
                icon="@Embed('assets/bullet_orange.png')" /&gt;
        &lt;mx:Object label="Yellow"
                icon="@Embed('assets/bullet_yellow.png')" /&gt;
        &lt;mx:Object label="Green"
                icon="@Embed('assets/bullet_green.png')" /&gt;
        &lt;mx:Object label="Blue"
                icon="@Embed('assets/bullet_blue.png')" /&gt;
    &lt;/mx:Array&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="buttonHeight:"&gt;
                &lt;mx:HSlider id="slider"
                        minimum="16"
                        maximum="48"
                        value="24"
                        snapInterval="1"
                        tickInterval="2"
                        liveDragging="true" /&gt;
            &lt;/mx:FormItem&gt;
            &lt;mx:FormItem label="direction:"&gt;
                &lt;mx:ComboBox id="comboBox"
                        dataProvider="[horizontal,vertical]" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:ButtonBar id="buttonBar"
            dataProvider="{arr}"
            buttonHeight="{slider.value}"
            direction="{comboBox.selectedItem}"
            buttonStyleName="buttonBarButtonStyles" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/ButtonBar_buttonHeight_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/ButtonBar_buttonHeight_test/bin/main.html" width="100%" height="360"></iframe></p>
<p>You can also set the <code>buttonHeight</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/ButtonBar_buttonHeight_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/30/setting-the-button-height-on-a-buttonbar-control-in-flex/ --&gt;
&lt;mx:Application name="ButtonBar_buttonHeight_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        ButtonBar {
            buttonHeight: 16;
            buttonStyleName: buttonBarButtonStyles;
        }

        .buttonBarButtonStyles {
            textAlign: left;
        }
    &lt;/mx:Style&gt;

    &lt;mx:Array id="arr"&gt;
        &lt;mx:Object label="Red"
                icon="@Embed('assets/bullet_red.png')" /&gt;
        &lt;mx:Object label="Orange"
                icon="@Embed('assets/bullet_orange.png')" /&gt;
        &lt;mx:Object label="Yellow"
                icon="@Embed('assets/bullet_yellow.png')" /&gt;
        &lt;mx:Object label="Green"
                icon="@Embed('assets/bullet_green.png')" /&gt;
        &lt;mx:Object label="Blue"
                icon="@Embed('assets/bullet_blue.png')" /&gt;
    &lt;/mx:Array&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="direction:"&gt;
                &lt;mx:ComboBox id="comboBox"
                        dataProvider="[horizontal,vertical]" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:ButtonBar id="buttonBar"
            dataProvider="{arr}"
            direction="{comboBox.selectedItem}" /&gt;

&lt;/mx:Application&gt;
</pre>
<p>Or, you can set the <code>buttonHeight</code> style using ActionScript, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/ButtonBar_buttonHeight_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/30/setting-the-button-height-on-a-buttonbar-control-in-flex/ --&gt;
&lt;mx:Application name="ButtonBar_buttonHeight_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        ButtonBar {
            buttonHeight: 24;
            buttonStyleName: buttonBarButtonStyles;
        }

        .buttonBarButtonStyles {
            textAlign: left;
        }
    &lt;/mx:Style&gt;

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

            private function slider_change(evt:SliderEvent):void {
                buttonBar.setStyle("buttonHeight", evt.value);
            }

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

    &lt;mx:Array id="arr"&gt;
        &lt;mx:Object label="Red"
                icon="@Embed('assets/bullet_red.png')" /&gt;
        &lt;mx:Object label="Orange"
                icon="@Embed('assets/bullet_orange.png')" /&gt;
        &lt;mx:Object label="Yellow"
                icon="@Embed('assets/bullet_yellow.png')" /&gt;
        &lt;mx:Object label="Green"
                icon="@Embed('assets/bullet_green.png')" /&gt;
        &lt;mx:Object label="Blue"
                icon="@Embed('assets/bullet_blue.png')" /&gt;
    &lt;/mx:Array&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="buttonHeight:"&gt;
                &lt;mx:HSlider id="slider"
                        minimum="16"
                        maximum="48"
                        value="24"
                        snapInterval="1"
                        tickInterval="2"
                        liveDragging="true"
                        change="slider_change(event);" /&gt;
            &lt;/mx:FormItem&gt;
            &lt;mx:FormItem label="direction:"&gt;
                &lt;mx:ComboBox id="comboBox"
                        dataProvider="[horizontal,vertical]"
                        change="comboBox_change(event);" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:ButtonBar id="buttonBar"
            dataProvider="{arr}" /&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/ButtonBar_buttonHeight_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/30/setting-the-button-height-on-a-buttonbar-control-in-flex/ --&gt;
&lt;mx:Application name="ButtonBar_buttonHeight_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.BoxDirection;
            import mx.containers.Form;
            import mx.containers.FormItem;
            import mx.controls.ButtonBar;
            import mx.controls.ComboBox;
            import mx.controls.HSlider;
            import mx.events.ListEvent;
            import mx.events.SliderEvent;

            [Embed("assets/bullet_red.png")]
            private const BulletRedIcon:Class;

            [Embed("assets/bullet_orange.png")]
            private const BulletOrangeIcon:Class;

            [Embed("assets/bullet_yellow.png")]
            private const BulletYellowIcon:Class;

            [Embed("assets/bullet_green.png")]
            private const BulletGreenIcon:Class;

            [Embed("assets/bullet_blue.png")]
            private const BulletBlueIcon:Class;

            private var buttonBarButtonStyles:CSSStyleDeclaration;
            private var arr:Array;
            private var slider:HSlider;
            private var comboBox:ComboBox;
            private var buttonBar:ButtonBar;

            private function init():void {
                arr = [];
                arr.push({label:"Red", icon:BulletRedIcon});
                arr.push({label:"Orange", icon:BulletOrangeIcon});
                arr.push({label:"Yellow", icon:BulletYellowIcon});
                arr.push({label:"Green", icon:BulletGreenIcon});
                arr.push({label:"Blue", icon:BulletBlueIcon});

                buttonBarButtonStyles = new CSSStyleDeclaration(".buttonBarButtonStyles");
                buttonBarButtonStyles.setStyle("textAlign", "left");

                slider = new HSlider();
                slider.minimum = 16;
                slider.maximum = 48;
                slider.value = 24;
                slider.snapInterval = 1;
                slider.tickInterval = 2;
                slider.liveDragging = true;
                slider.addEventListener(SliderEvent.CHANGE,
                            slider_change);

                comboBox = new ComboBox();
                comboBox.dataProvider = [BoxDirection.HORIZONTAL, BoxDirection.VERTICAL];
                comboBox.addEventListener(ListEvent.CHANGE,
                            comboBox_change);

                var formItem1:FormItem = new FormItem();
                formItem1.label = "buttonHeight:";
                formItem1.addChild(slider);

                var formItem2:FormItem = new FormItem();
                formItem2.label = "direction:";
                formItem2.addChild(comboBox);

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

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

                buttonBar = new ButtonBar();
                buttonBar.dataProvider = arr;
                buttonBar.setStyle("buttonHeight", 24);
                buttonBar.setStyle("buttonStyleName", "buttonBarButtonStyles");
                addChild(buttonBar);
            }

            private function slider_change(evt:SliderEvent):void {
                buttonBar.setStyle("buttonHeight", evt.value);
            }

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

&lt;/mx:Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting the button height on a ButtonBar control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/09/30/setting-the-button-height-on-a-buttonbar-control-in-flex/',contentID: 'post-813',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'buttonHeight,direction,textAlign',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/30/setting-the-button-height-on-a-buttonbar-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting the layout direction of a TileList control in Flex</title>
		<link>http://blog.flexexamples.com/2008/03/23/setting-the-layout-direction-of-a-tilelist-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/03/23/setting-the-layout-direction-of-a-tilelist-control-in-flex/#comments</comments>
		<pubDate>Mon, 24 Mar 2008 05:06:51 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[TileList]]></category>
		<category><![CDATA[direction]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/03/23/setting-the-layout-direction-of-a-tilelist-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can toggle the item layout direction of the Flex TileList control by setting the direction property to &#8220;horizontal&#8221; or &#8220;vertical&#8221;.</p> <p>Full code after the jump.</p> <p></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/03/23/setting-the-layout-direction-of-a-tilelist-control-in-flex/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:Script&#62; &#60;![CDATA[ import mx.events.ItemClickEvent; private function toggleButtonBar_itemClick(evt:ItemClickEvent):void { tileList.direction = evt.item.label; } [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can toggle the item layout direction of the Flex TileList control by setting the <code>direction</code> property to &#8220;horizontal&#8221; or &#8220;vertical&#8221;.</p>
<p>Full code after the jump.</p>
<p><span id="more-557"></span></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/03/23/setting-the-layout-direction-of-a-tilelist-control-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

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

            private function toggleButtonBar_itemClick(evt:ItemClickEvent):void {
                tileList.direction = evt.item.label;
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Array id="arr"&gt;
        &lt;mx:Object label="horizontal" /&gt;
        &lt;mx:Object label="vertical" /&gt;
    &lt;/mx:Array&gt;

    &lt;mx:ArrayCollection id="arrColl"&gt;
        &lt;mx:source&gt;
            &lt;mx:Array&gt;
                &lt;mx:Object label="ColdFusion" icon="@Embed('assets/cf_appicon-tn.gif')" /&gt;
                &lt;mx:Object label="Dreamweaver" icon="@Embed('assets/dw_appicon-tn.gif')" /&gt;
                &lt;mx:Object label="Fireworks" icon="@Embed('assets/fw_appicon-tn.gif')" /&gt;
                &lt;mx:Object label="Flash" icon="@Embed('assets/fl_appicon-tn.gif')" /&gt;
                &lt;mx:Object label="Flash Player" icon="@Embed('assets/fl_player_appicon-tn.gif')" /&gt;
                &lt;mx:Object label="Flex" icon="@Embed('assets/fx_appicon-tn.gif')" /&gt;
                &lt;mx:Object label="Illustrator" icon="@Embed('assets/ai_appicon-tn.gif')" /&gt;
                &lt;mx:Object label="Lightroom" icon="@Embed('assets/lr_appicon-tn.gif')" /&gt;
                &lt;mx:Object label="Photoshop" icon="@Embed('assets/ps_appicon-tn.gif')" /&gt;
            &lt;/mx:Array&gt;
        &lt;/mx:source&gt;
    &lt;/mx:ArrayCollection&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="direction:"&gt;
                &lt;mx:ToggleButtonBar id="toggleButtonBar"
                        dataProvider="{arr}"
                        selectedIndex="0"
                        itemClick="toggleButtonBar_itemClick(event);" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:TileList id="tileList"
            dataProvider="{arrColl}"
            alternatingItemColors="[#FFFFFF,#EEEEEE]"
            columnCount="3"
            columnWidth="100"
            rowCount="2"
            rowHeight="100"
            direction="horizontal"
            horizontalScrollPolicy="on"
            verticalScrollPolicy="on" /&gt;

&lt;/mx:Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting the layout direction of a TileList control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/03/23/setting-the-layout-direction-of-a-tilelist-control-in-flex/',contentID: 'post-557',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/03/23/setting-the-layout-direction-of-a-tilelist-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Changing the layout direction of a form item in Flex</title>
		<link>http://blog.flexexamples.com/2008/03/18/changing-the-layout-direction-of-a-form-item-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/03/18/changing-the-layout-direction-of-a-form-item-in-flex/#comments</comments>
		<pubDate>Wed, 19 Mar 2008 05:09:47 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[FormItem]]></category>
		<category><![CDATA[Forms]]></category>
		<category><![CDATA[direction]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/03/18/changing-the-layout-direction-of-a-form-item-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can change the direction of a FormItem container in Flex by setting the direction property to &#8220;horizontal&#8221; or &#8220;vertical&#8221;.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/FormItem_direction_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/03/18/changing-the-layout-direction-of-a-form-item-in-flex/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:Style&#62; FormItem { labelStyleName: myFormItemLabelStyleName; } .myFormItemLabelStyleName { fontWeight: [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can change the direction of a FormItem container in Flex by setting the <code>direction</code> property to &#8220;horizontal&#8221; or &#8220;vertical&#8221;.</p>
<p>Full code after the jump.</p>
<p><span id="more-566"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/FormItem_direction_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/03/18/changing-the-layout-direction-of-a-form-item-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;
        FormItem {
            labelStyleName: myFormItemLabelStyleName;
        }

        .myFormItemLabelStyleName {
            fontWeight: bold;
        }
    &lt;/mx:Style&gt;

    &lt;mx:Form id="form"&gt;
        &lt;mx:FormItem label="horizontal:"
                direction="horizontal"&gt;
            &lt;mx:Image source="{Icons.AIR_ICON}"
                    toolTip="Adobe AIR" /&gt;
            &lt;mx:Image source="{Icons.FLASH_ICON}"
                    toolTip="Adobe Flash" /&gt;
            &lt;mx:Image source="{Icons.FLASH_PLAYER_ICON}"
                    toolTip="Adobe Flash Player" /&gt;
            &lt;mx:Image source="{Icons.FLEX_ICON}"
                    toolTip="Adobe Flex" /&gt;
        &lt;/mx:FormItem&gt;
        &lt;mx:FormItem label="vertical:"
                direction="vertical"&gt;
            &lt;mx:Image source="{Icons.AIR_ICON}"
                    toolTip="Adobe AIR" /&gt;
            &lt;mx:Image source="{Icons.FLASH_ICON}"
                    toolTip="Adobe Flash" /&gt;
            &lt;mx:Image source="{Icons.FLASH_PLAYER_ICON}"
                    toolTip="Adobe Flash Player" /&gt;
            &lt;mx:Image source="{Icons.FLEX_ICON}"
                    toolTip="Adobe Flex" /&gt;
        &lt;/mx:FormItem&gt;
    &lt;/mx:Form&gt;

&lt;/mx:Application&gt;
</pre>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/FormItem_direction_test/bin/srcview/source/Icons.as.html">/src/Icons.as</a></p>
<pre class="code">
/** http://blog.flexexamples.com/2008/03/18/changing-the-layout-direction-of-a-form-item-in-flex/ */
package {
    [Bindable]
    public class Icons {
        public function Icons() {
        }

        [Embed("assets/air_appicon-tn.gif")]
        public static var AIR_ICON:Class;

        [Embed("assets/fl_appicon-tn.gif")]
        public static var FLASH_ICON:Class;

        [Embed("assets/fl_player_appicon-tn.gif")]
        public static var FLASH_PLAYER_ICON:Class;

        [Embed("assets/fx_appicon-tn.gif")]
        public static var FLEX_ICON:Class;
    }
}
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/FormItem_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/FormItem_direction_test/bin/main.html" width="100%" height="400"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Changing the layout direction of a form item in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/03/18/changing-the-layout-direction-of-a-form-item-in-flex/',contentID: 'post-566',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/03/18/changing-the-layout-direction-of-a-form-item-in-flex/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Setting the layout direction of a Flex ControlBar container</title>
		<link>http://blog.flexexamples.com/2008/02/13/setting-the-layout-direction-of-a-flex-controlbar-container/</link>
		<comments>http://blog.flexexamples.com/2008/02/13/setting-the-layout-direction-of-a-flex-controlbar-container/#comments</comments>
		<pubDate>Thu, 14 Feb 2008 05:01:23 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[ControlBar]]></category>
		<category><![CDATA[direction]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/02/13/setting-the-layout-direction-of-a-flex-controlbar-container/</guid>
		<description><![CDATA[<p>The following example shows how you can set the child layout direction of a ControlBar container in Flex by setting the direction property.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/ControlBar_direction_test/main.mxml">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/02/13/setting-the-layout-direction-of-a-flex-controlbar-container/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:Array id="arr"&#62; &#60;mx:Object label="Button" /&#62; &#60;mx:Object label="ButtonBar" /&#62; &#60;mx:Object label="CheckBox" /&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set the child layout direction of a ControlBar container in Flex by setting the <code>direction</code> property.</p>
<p>Full code after the jump.</p>
<p><span id="more-444"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/ControlBar_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/02/13/setting-the-layout-direction-of-a-flex-controlbar-container/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Array id="arr"&gt;
        &lt;mx:Object label="Button" /&gt;
        &lt;mx:Object label="ButtonBar" /&gt;
        &lt;mx:Object label="CheckBox" /&gt;
        &lt;mx:Object label="ColorPicker" /&gt;
        &lt;mx:Object label="ComboBox" /&gt;
        &lt;mx:Object label="DataGrid" /&gt;
    &lt;/mx:Array&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:ToggleButtonBar id="toggleButtonBar"
                selectedIndex="1"
                itemClick="cBar.direction = event.label;"&gt;
            &lt;mx:dataProvider&gt;
                &lt;mx:Array&gt;
                    &lt;mx:String&gt;horizontal&lt;/mx:String&gt;
                    &lt;mx:String&gt;vertical&lt;/mx:String&gt;
                &lt;/mx:Array&gt;
            &lt;/mx:dataProvider&gt;
        &lt;/mx:ToggleButtonBar&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:Panel id="panel"
            width="320"
            height="160"&gt;
        &lt;mx:List id="list"
                dataProvider="{arr}"
                width="100%"
                rowCount="{arr.length}" /&gt;
        &lt;mx:ControlBar id="cBar"
                direction="vertical"
                horizontalAlign="right"&gt;
            &lt;mx:Button label="Submit" /&gt;
            &lt;mx:Button label="Cancel" /&gt;
        &lt;/mx:ControlBar&gt;
    &lt;/mx:Panel&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/ControlBar_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/ControlBar_direction_test/bin/main.html" width="100%" height="300"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting the layout direction of a Flex ControlBar container on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/02/13/setting-the-layout-direction-of-a-flex-controlbar-container/',contentID: 'post-444',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/02/13/setting-the-layout-direction-of-a-flex-controlbar-container/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting horizontal and vertical gaps between buttons in a Flex ButtonBar control</title>
		<link>http://blog.flexexamples.com/2008/01/08/setting-horizontal-and-vertical-gaps-between-buttons-in-a-flex-buttonbar-control/</link>
		<comments>http://blog.flexexamples.com/2008/01/08/setting-horizontal-and-vertical-gaps-between-buttons-in-a-flex-buttonbar-control/#comments</comments>
		<pubDate>Wed, 09 Jan 2008 07:52:31 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[ButtonBar]]></category>
		<category><![CDATA[direction]]></category>
		<category><![CDATA[horizontalGap]]></category>
		<category><![CDATA[verticalGap]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/08/setting-horizontal-and-vertical-gaps-between-buttons-in-a-flex-buttonbar-control/</guid>
		<description><![CDATA[<p>The following example shows how you can control the horizontal and vertical gaps between buttons in a ButtonBar control in Flex by setting the verticalGap and horizontalGap styles.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/ButtonBar_verticalGap_test/main.mxml">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/01/08/setting-horizontal-and-vertical-gaps-between-buttons-in-a-flex-buttonbar-control/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:Array id="arr"&#62; &#60;mx:Object label="The" /&#62; &#60;mx:Object [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can control the horizontal and vertical gaps between buttons in a ButtonBar control in Flex by setting the <code>verticalGap</code> and <code>horizontalGap</code> styles.</p>
<p>Full code after the jump.</p>
<p><span id="more-433"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/ButtonBar_verticalGap_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/08/setting-horizontal-and-vertical-gaps-between-buttons-in-a-flex-buttonbar-control/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="horizontal"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Array id="arr"&gt;
        &lt;mx:Object label="The" /&gt;
        &lt;mx:Object label="quick" /&gt;
        &lt;mx:Object label="brown" /&gt;
        &lt;mx:Object label="fox" /&gt;
    &lt;/mx:Array&gt;

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

    &lt;mx:ButtonBar id="buttonBar"
            dataProvider="{arr}"
            verticalGap="{slider.value}"
            direction="vertical" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/ButtonBar_verticalGap_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/ButtonBar_verticalGap_test/bin/main.html" width="100%" height="250"></iframe></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/ButtonBar_horizontalGap_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/08/setting-horizontal-and-vertical-gaps-between-buttons-in-a-flex-buttonbar-control/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="horizontal"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Array id="arr"&gt;
        &lt;mx:Object label="The" /&gt;
        &lt;mx:Object label="quick" /&gt;
        &lt;mx:Object label="brown" /&gt;
        &lt;mx:Object label="fox" /&gt;
    &lt;/mx:Array&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="-2"
                        maximum="10"
                        value="0"
                        liveDragging="true"
                        snapInterval="1"
                        tickInterval="1" /&gt;
                &lt;mx:Label text="{slider.value}" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:ButtonBar id="buttonBar"
            dataProvider="{arr}"
            horizontalGap="{slider.value}"
            direction="horizontal" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/ButtonBar_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/ButtonBar_horizontalGap_test/bin/main.html" width="100%" height="120"></iframe></p>
<p>You could also set the <code>horizontalGap</code> or <code>verticalGap</code> style in an external .CSS file or &lt;mx:Style /&gt; block, as seen in the following snippet:</p>
<pre class="code">
&lt;mx:Style&gt;
    ButtonBar {
        horizontalGap: 16;
    }
&lt;/mx:Style&gt;
</pre>
<p>Or, you can set the <code>horizontalGap</code> or <code>verticalGap</code> style using ActionScript, as seen in the following snippet:</p>
<pre class="code">
&lt;mx:Script&gt;
    &lt;![CDATA[
        private function init():void {
            buttonBar.setStyle("horizontalGap", 16);
        }
    ]]&gt;
&lt;/mx:Script&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting horizontal and vertical gaps between buttons in a Flex ButtonBar control on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/01/08/setting-horizontal-and-vertical-gaps-between-buttons-in-a-flex-buttonbar-control/',contentID: 'post-433',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'direction,horizontalGap,verticalGap',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/08/setting-horizontal-and-vertical-gaps-between-buttons-in-a-flex-buttonbar-control/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<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>
		<item>
		<title>Changing a chart legend&#8217;s direction</title>
		<link>http://blog.flexexamples.com/2007/11/17/changing-a-chart-legends-direction/</link>
		<comments>http://blog.flexexamples.com/2007/11/17/changing-a-chart-legends-direction/#comments</comments>
		<pubDate>Sat, 17 Nov 2007 07:09:11 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Charting]]></category>
		<category><![CDATA[Legend]]></category>
		<category><![CDATA[LineChart]]></category>
		<category><![CDATA[direction]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/11/17/changing-a-chart-legends-direction/</guid>
		<description><![CDATA[<p>The following example shows how you can change the direction of a Flex chart&#8217;s legend by setting the direction property, as seen in the following snippet:</p> &#60;mx:Legend dataProvider="{lineChart}" direction="horizontal" /&#62; <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Legend_direction_test/main.mxml">View MXML</a></p> &#60;?xml version="1.0"?&#62; &#60;!-- http://blog.flexexamples.com/2007/11/17/changing-a-chart-legends-direction/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:Script&#62; &#60;![CDATA[ import mx.events.ItemClickEvent; private [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can change the direction of a Flex chart&#8217;s legend by setting the <code>direction</code> property, as seen in the following snippet:</p>
<pre class="code">
&lt;mx:Legend dataProvider="{lineChart}" direction="horizontal" /&gt;
</pre>
<p>Full code after the jump.</p>
<p><span id="more-309"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Legend_direction_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0"?&gt;
&lt;!-- http://blog.flexexamples.com/2007/11/17/changing-a-chart-legends-direction/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

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

            private function toggleButtonBar_itemClick(evt:ItemClickEvent):void {
                var idx:uint = ToggleButtonBar(evt.currentTarget).selectedIndex;
                legend.direction = arr[idx];
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:XMLListCollection id="dp"&gt;
        &lt;mx:source&gt;
            &lt;mx:XMLList&gt;
                &lt;quote date="8/27/2007" open="40.38" close="40.81" /&gt;
                &lt;quote date="8/24/2007" open="40.5" close="40.41" /&gt;
                &lt;quote date="8/23/2007" open="40.82" close="40.6" /&gt;
                &lt;quote date="8/22/2007" open="40.4" close="40.77" /&gt;
                &lt;quote date="8/21/2007" open="40.41" close="40.13" /&gt;
                &lt;quote date="8/20/2007" open="40.55" close="40.74" /&gt;
                &lt;quote date="8/17/2007" open="40.18" close="40.32" /&gt;
                &lt;quote date="8/16/2007" open="39.83" close="39.96" /&gt;
                &lt;quote date="8/15/2007" open="40.22" close="40.18" /&gt;
                &lt;quote date="8/14/2007" open="41.01" close="40.41" /&gt;
                &lt;quote date="8/13/2007" open="41" close="40.83" /&gt;
                &lt;quote date="8/10/2007" open="41.3" close="41.06" /&gt;
                &lt;quote date="8/9/2007" open="39.9" close="40.75" /&gt;
                &lt;quote date="8/8/2007" open="39.61" close="40.23" /&gt;
                &lt;quote date="8/7/2007" open="39.08" close="39.42" /&gt;
                &lt;quote date="8/6/2007" open="38.71" close="39.38" /&gt;
                &lt;quote date="8/3/2007" open="39.47" close="38.75" /&gt;
                &lt;quote date="8/2/2007" open="39.4" close="39.52" /&gt;
                &lt;quote date="8/1/2007" open="40.29" close="39.58" /&gt;
            &lt;/mx:XMLList&gt;
        &lt;/mx:source&gt;
    &lt;/mx:XMLListCollection&gt;

    &lt;mx:Array id="arr"&gt;
        &lt;mx:String&gt;horizontal&lt;/mx:String&gt;
        &lt;mx:String&gt;vertical&lt;/mx:String&gt;
    &lt;/mx:Array&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:ToggleButtonBar id="toggleButtonBar"
                dataProvider="{arr}"
                selectedIndex="0"
                itemClick="toggleButtonBar_itemClick(event);" /&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:LineChart id="lineChart"
            showDataTips="true"
            dataProvider="{dp}"
            width="100%"
            height="100%"&gt;

        &lt;!-- series filters --&gt;
        &lt;mx:seriesFilters&gt;
            &lt;mx:Array /&gt;
        &lt;/mx:seriesFilters&gt;

        &lt;!-- vertical axis --&gt;
        &lt;mx:verticalAxis&gt;
            &lt;mx:LinearAxis baseAtZero="false"
                    title="Price" /&gt;
        &lt;/mx:verticalAxis&gt;

        &lt;!-- horizontal axis --&gt;
        &lt;mx:horizontalAxis&gt;
            &lt;mx:CategoryAxis id="ca"
                    categoryField="@date"
                    title="Date" /&gt;
        &lt;/mx:horizontalAxis&gt;

        &lt;!-- horizontal axis renderer --&gt;
        &lt;mx:horizontalAxisRenderers&gt;
            &lt;mx:AxisRenderer axis="{ca}"
                    canDropLabels="true" /&gt;
        &lt;/mx:horizontalAxisRenderers&gt;

        &lt;!-- series --&gt;
        &lt;mx:series&gt;
            &lt;mx:LineSeries yField="@close"
                    form="curve"
                    displayName="Close" /&gt;
            &lt;mx:LineSeries yField="@open"
                    form="curve"
                    displayName="Open" /&gt;
        &lt;/mx:series&gt;
    &lt;/mx:LineChart&gt;

    &lt;mx:ControlBar&gt;
        &lt;mx:Legend id="legend"
                dataProvider="{lineChart}"
                direction="horizontal" /&gt;
    &lt;/mx:ControlBar&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Legend_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/Legend_direction_test/bin/main.html" width="100%" height="500"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Changing a chart legend\&#039;s direction on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/11/17/changing-a-chart-legends-direction/',contentID: 'post-309',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/2007/11/17/changing-a-chart-legends-direction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Displaying grid lines in a Flex LineChart control</title>
		<link>http://blog.flexexamples.com/2007/11/15/displaying-grid-lines-in-a-flex-linechart-control/</link>
		<comments>http://blog.flexexamples.com/2007/11/15/displaying-grid-lines-in-a-flex-linechart-control/#comments</comments>
		<pubDate>Fri, 16 Nov 2007 04:37:01 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Charting]]></category>
		<category><![CDATA[GridLines]]></category>
		<category><![CDATA[LineChart]]></category>
		<category><![CDATA[backgroundElements]]></category>
		<category><![CDATA[direction]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/11/15/displaying-grid-lines-in-a-flex-linechart-control/</guid>
		<description><![CDATA[<p>The following example shows how you can add horizontal or vertical (or both) grid lines to a LineChart contol in Flex by setting the direction style in the GridLines tags, as seen in the following snippet:</p> &#60;mx:LineChart dataProvider=&#34;{dp}&#34;&#62; &#60;mx:backgroundElements&#62; &#60;mx:GridLines direction=&#34;vertical&#34; /&#62; &#60;/mx:backgroundElements&#62; &#60;/mx:LineChart&#62; <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/LineChart_backgroundElements_GridLines_test/main.mxml">View MXML</a></p> &#60;?xml [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can add horizontal or vertical (or both) grid lines to a LineChart contol in Flex by setting the <code>direction</code> style in the GridLines tags, as seen in the following snippet:</p>
<pre class="code">
&lt;mx:LineChart dataProvider=&quot;{dp}&quot;&gt;

    <span style="color:red;">&lt;mx:backgroundElements&gt;
        &lt;mx:GridLines direction=&quot;vertical&quot; /&gt;
    &lt;/mx:backgroundElements&gt;</span>

&lt;/mx:LineChart&gt;
</pre>
<p>Full code after the jump.</p>
<p><span id="more-302"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/LineChart_backgroundElements_GridLines_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0"?&gt;
&lt;!-- http://blog.flexexamples.com/2007/11/15/displaying-grid-lines-in-a-flex-linechart-control/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:XMLListCollection id="dp"&gt;
        &lt;mx:source&gt;
            &lt;mx:XMLList&gt;
                &lt;quote date="8/27/2007" open="40.38" close="40.81" /&gt;
                &lt;quote date="8/24/2007" open="40.5" close="40.41" /&gt;
                &lt;quote date="8/23/2007" open="40.82" close="40.6" /&gt;
                &lt;quote date="8/22/2007" open="40.4" close="40.77" /&gt;
                &lt;quote date="8/21/2007" open="40.41" close="40.13" /&gt;
                &lt;quote date="8/20/2007" open="40.55" close="40.74" /&gt;
                &lt;quote date="8/17/2007" open="40.18" close="40.32" /&gt;
                &lt;quote date="8/16/2007" open="39.83" close="39.96" /&gt;
                &lt;quote date="8/15/2007" open="40.22" close="40.18" /&gt;
                &lt;quote date="8/14/2007" open="41.01" close="40.41" /&gt;
                &lt;quote date="8/13/2007" open="41" close="40.83" /&gt;
                &lt;quote date="8/10/2007" open="41.3" close="41.06" /&gt;
                &lt;quote date="8/9/2007" open="39.9" close="40.75" /&gt;
                &lt;quote date="8/8/2007" open="39.61" close="40.23" /&gt;
                &lt;quote date="8/7/2007" open="39.08" close="39.42" /&gt;
                &lt;quote date="8/6/2007" open="38.71" close="39.38" /&gt;
                &lt;quote date="8/3/2007" open="39.47" close="38.75" /&gt;
                &lt;quote date="8/2/2007" open="39.4" close="39.52" /&gt;
                &lt;quote date="8/1/2007" open="40.29" close="39.58" /&gt;
            &lt;/mx:XMLList&gt;
        &lt;/mx:source&gt;
    &lt;/mx:XMLListCollection&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="GridLines direction:"&gt;
                &lt;mx:ToggleButtonBar id="toggleButtonBar" selectedIndex="0"&gt;
                    &lt;mx:dataProvider&gt;
                        &lt;mx:Array&gt;
                            &lt;mx:String&gt;horizontal&lt;/mx:String&gt;
                            &lt;mx:String&gt;vertical&lt;/mx:String&gt;
                            &lt;mx:String&gt;both&lt;/mx:String&gt;
                        &lt;/mx:Array&gt;
                    &lt;/mx:dataProvider&gt;
                &lt;/mx:ToggleButtonBar&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:LineChart id="lineChart"
            showDataTips="true"
            dataProvider="{dp}"
            width="100%"
            height="100%"&gt;

        &lt;mx:backgroundElements&gt;
            &lt;mx:GridLines direction="{toggleButtonBar.dataProvider.getItemAt(toggleButtonBar.selectedIndex)}" /&gt;
        &lt;/mx:backgroundElements&gt;

        &lt;!-- vertical axis --&gt;
        &lt;mx:verticalAxis&gt;
            &lt;mx:LinearAxis baseAtZero="false" title="Price" /&gt;
        &lt;/mx:verticalAxis&gt;

        &lt;!-- horizontal axis --&gt;
        &lt;mx:horizontalAxis&gt;
            &lt;mx:CategoryAxis id="ca" categoryField="@date" title="Date" /&gt;
        &lt;/mx:horizontalAxis&gt;

        &lt;!-- horizontal axis renderer --&gt;
        &lt;mx:horizontalAxisRenderers&gt;
            &lt;mx:AxisRenderer axis="{ca}" canDropLabels="true" /&gt;
        &lt;/mx:horizontalAxisRenderers&gt;

        &lt;!-- series --&gt;
        &lt;mx:series&gt;
            &lt;mx:LineSeries yField="@open" form="curve" displayName="Open" /&gt;
        &lt;/mx:series&gt;
    &lt;/mx:LineChart&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/LineChart_backgroundElements_GridLines_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/LineChart_backgroundElements_GridLines_test/bin/main.html" width="100%" height="500"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Displaying grid lines in a Flex LineChart control on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/11/15/displaying-grid-lines-in-a-flex-linechart-control/',contentID: 'post-302',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'backgroundElements,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/2007/11/15/displaying-grid-lines-in-a-flex-linechart-control/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
	</channel>
</rss>

