<?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; depthColors</title>
	<atom:link href="http://blog.flexexamples.com/tag/depthcolors/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>Alternating row colors in a Flex Tree control using the depthColors style</title>
		<link>http://blog.flexexamples.com/2007/11/27/alternating-row-colors-in-a-flex-tree-control-using-the-depthcolors-style/</link>
		<comments>http://blog.flexexamples.com/2007/11/27/alternating-row-colors-in-a-flex-tree-control-using-the-depthcolors-style/#comments</comments>
		<pubDate>Wed, 28 Nov 2007 05:22:54 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Tree]]></category>
		<category><![CDATA[depthColors]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/11/27/alternating-row-colors-in-a-flex-tree-control-using-the-depthcolors-style/</guid>
		<description><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2007/11/27/alternating-row-colors-in-a-flex-tree-control-using-the-alternatingitemcolors-style/">&#8220;Alternating row colors in a Flex Tree control using the alternatingItemColors style&#8221;</a>, we saw how you can alternate row colors by setting the alternatingItemColors style.<br /> The following example shows how you can alternate item colors based on the item&#8217;s depth in a Flex Tree control by setting the depthColors [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2007/11/27/alternating-row-colors-in-a-flex-tree-control-using-the-alternatingitemcolors-style/">&#8220;Alternating row colors in a Flex Tree control using the alternatingItemColors style&#8221;</a>, we saw how you can alternate row colors by setting the <code>alternatingItemColors</code> style.<br />
The following example shows how you can alternate item colors based on the item&#8217;s depth in a Flex Tree control by setting the <code>depthColors</code> style to an array of colors.</p>
<p>Full code after the jump.</p>
<p><span id="more-336"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Tree_depthColors_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/11/27/alternating-row-colors-in-a-flex-tree-control-using-the-depthcolors-style/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:XMLListCollection id="xmlListColl"&gt;
        &lt;mx:source&gt;
            &lt;mx:XMLList&gt;
                &lt;node label="One"&gt;
                    &lt;node label="One.1"&gt;
                        &lt;node label="One.1.1"&gt;
                            &lt;node label="One.1.1.1"&gt;
                                &lt;node label="One.1.1.1.1" /&gt;
                            &lt;/node&gt;
                        &lt;/node&gt;
                    &lt;/node&gt;
                    &lt;node label="One.2" /&gt;
                    &lt;node label="One.3" /&gt;
                &lt;/node&gt;
                &lt;node label="Two"&gt;
                    &lt;node label="Two.1" /&gt;
                    &lt;node label="Two.2" /&gt;
                    &lt;node label="Two.3" /&gt;
                &lt;/node&gt;
            &lt;/mx:XMLList&gt;
        &lt;/mx:source&gt;
    &lt;/mx:XMLListCollection&gt;

    &lt;mx:Tree id="tree"
            dataProvider="{xmlListColl}"
            labelField="@label"
            depthColors="[#FFFFFF, #EEEEEE, #DDDDDD, #CCCCCC, #BBBBBB, #AAAAAA]"
            rowCount="4"
            width="300" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Tree_depthColors_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/Tree_depthColors_test/bin/main.html" width="100%" height="200"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Alternating row colors in a Flex Tree control using the depthColors style on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/11/27/alternating-row-colors-in-a-flex-tree-control-using-the-depthcolors-style/',contentID: 'post-336',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'depthColors',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/27/alternating-row-colors-in-a-flex-tree-control-using-the-depthcolors-style/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

