<?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; TileDirection</title>
	<atom:link href="http://blog.flexexamples.com/category/tiledirection/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Wed, 26 Jan 2011 18:09:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Changing a Tile container&#8217;s child layout direction</title>
		<link>http://blog.flexexamples.com/2007/08/25/changing-a-tile-containers-child-layout-direction/</link>
		<comments>http://blog.flexexamples.com/2007/08/25/changing-a-tile-containers-child-layout-direction/#comments</comments>
		<pubDate>Sat, 25 Aug 2007 15:52:50 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Tile]]></category>
		<category><![CDATA[TileDirection]]></category>
		<category><![CDATA[direction]]></category>
		<category><![CDATA[tileHeight]]></category>
		<category><![CDATA[tileWidth]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/08/25/changing-a-tile-containers-child-layout-direction/</guid>
		<description><![CDATA[<p>The following example lets you change a Tile container&#8217;s direction property to control whether the container&#8217;s children are arranged from left to right, or top to bottom. You can also use two slider controls to change the value of the tileWidth and tileHeight properties.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Tile_direction_test/main.mxml">View MXML</a></p> &#60;?xml [...]]]></description>
			<content:encoded><![CDATA[<p>The following example lets you change a Tile container&#8217;s <code>direction</code> property to control whether the container&#8217;s children are arranged from left to right, or top to bottom. You can also use two slider controls to change the value of the <code>tileWidth</code> and <code>tileHeight</code> properties.</p>
<p>Full code after the jump.</p>
<p><span id="more-122"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Tile_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/2007/08/25/changing-a-tile-containers-child-layout-direction/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        Tile {
            paddingLeft: 10;
            paddingRight: 10;
            paddingTop: 10;
            paddingBottom: 10;
        }
    &lt;/mx:Style&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Label text="direction:" /&gt;
        &lt;mx:ComboBox id="comboBox"&gt;
            &lt;mx:dataProvider&gt;
                &lt;mx:String&gt;{mx.containers.TileDirection.HORIZONTAL}&lt;/mx:String&gt;
                &lt;mx:String&gt;{mx.containers.TileDirection.VERTICAL}&lt;/mx:String&gt;
            &lt;/mx:dataProvider&gt;
        &lt;/mx:ComboBox&gt;

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

        &lt;mx:Label text="tileWidth ({tileW.value}):" /&gt;
        &lt;mx:HSlider id="tileW"
                minimum="30"
                maximum="90"
                value="30"
                liveDragging="true"
                snapInterval="5"
                tickInterval="10"
                dataTipPrecision="0" /&gt;

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

        &lt;mx:Label text="tileHeight ({tileH.value}):" /&gt;
        &lt;mx:HSlider id="tileH"
                minimum="30"
                maximum="60"
                value="30"
                liveDragging="true"
                snapInterval="5"
                tickInterval="10"
                dataTipPrecision="0" /&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:Tile backgroundColor="haloSilver"
            direction="{comboBox.selectedItem}"
            tileWidth="{tileW.value}"
            tileHeight="{tileH.value}"&gt;
        &lt;mx:Button label="1" width="100%" height="100%" /&gt;
        &lt;mx:Button label="2" width="100%" height="100%" /&gt;
        &lt;mx:Button label="3" width="100%" height="100%" /&gt;
        &lt;mx:Button label="4" width="100%" height="100%" /&gt;
        &lt;mx:Button label="5" width="100%" height="100%" /&gt;
        &lt;mx:Button label="6" width="100%" height="100%" /&gt;
        &lt;mx:Button label="7" width="100%" height="100%" /&gt;
    &lt;/mx:Tile&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Tile_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/Tile_direction_test/bin/main.html" width="100%" height="300"></iframe></p>
<p>When the Tile container&#8217;s <code>direction</code> property is set to &#8220;horizontal&#8221; (or <code>TileDirection.HORIZONTAL</code>) you can see that the children are laid out left to right then top to bottom, like:</p>
<pre>
[1][2][3]
[4][5][6]
[7]
</pre>
<p>But if you change the <code>direction</code> property to &#8220;vertical&#8221; (or <code>TileDirection.VERTICAL</code>) you can see that the children are laid out top to bottom then left to right, like:</p>
<pre>
[1][4][7]
[2][5]
[3][6]
</pre>
<p>Happy Flexing!</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Changing a Tile container\&#039;s child layout direction on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/08/25/changing-a-tile-containers-child-layout-direction/',contentID: 'post-122',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'direction,tileHeight,tileWidth',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/08/25/changing-a-tile-containers-child-layout-direction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

