Set depthColors for Tree control through xml attribute
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:XMLList id="treeData">
<node label="File">
<node label="Save">
<node label="Doc" />
<node label="Pdf" />
<node label="Rdf" />
</node>
<node label="Edit">
<node label="Cut" />
<node label="Copy" />
<node label="Paste" />
</node>
<node label="Window" />
<node label="Help" />
</node>
</mx:XMLList>
<mx:Panel title="Tree Control Example" width="100%">
<mx:Tree id="myOtherTree" width="100%" labelField="@label"
dataProvider="{treeData}"
depthColors="[0xFFCC33, 0xFFCC99, 0xCC9900]"
alternatingItemColors="['red', 'green']" />
</mx:Panel>
</mx:Application>
Related examples in the same category