<?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; Tree</title>
	<atom:link href="http://blog.flexexamples.com/category/halo/tree/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>Removing the border from the Halo Tree control in Flex 4</title>
		<link>http://blog.flexexamples.com/2009/08/28/removing-the-border-from-the-halo-tree-control-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2009/08/28/removing-the-border-from-the-halo-tree-control-in-flex-4/#comments</comments>
		<pubDate>Fri, 28 Aug 2009 13:56:12 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta1]]></category>
		<category><![CDATA[Tree]]></category>
		<category><![CDATA[borderSkin]]></category>
		<category><![CDATA[Gumbo]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=1759</guid>
		<description><![CDATA[<p>The following example shows how you can remove or modify the border on the Halo Tree control (with default Spark skin) in Flex 4 by setting the borderSkin style.</p> <p>Full code after the jump.</p> <p></p> &#60;?xml version=&#34;1.0&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2009/08/28/removing-the-border-from-the-halo-tree-control-in-flex-4/ --&#62; &#60;s:Application name=&#34;Halo_Tree_borderSkin_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; &#160; &#60;mx:Tree id=&#34;tree1&#34; labelField=&#34;@label&#34; showRoot=&#34;true&#34; borderSkin=&#34;{null}&#34; width=&#34;160&#34; horizontalCenter=&#34;0&#34; verticalCenter=&#34;0&#34;&#62; &#60;mx:XMLListCollection [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can remove or modify the border on the Halo Tree control (with default Spark skin) in Flex 4 by setting the <code>borderSkin</code> style.</p>
<p>Full code after the jump.</p>
<p><span id="more-1759"></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>?<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/28/removing-the-border-from-the-halo-tree-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;Halo_Tree_borderSkin_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;mx:Tree</span> id=<span style="color: #ff0000;">&quot;tree1&quot;</span></span>
<span style="color: #000000;">            labelField=<span style="color: #ff0000;">&quot;@label&quot;</span></span>
<span style="color: #000000;">            showRoot=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #000000;">            borderSkin=<span style="color: #ff0000;">&quot;{null}&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;160&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:XMLListCollection</span> id=<span style="color: #ff0000;">&quot;MailBox&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:XMLList</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;">&lt;folder label=<span style="color: #ff0000;">&quot;Mail&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;">&lt;folder label=<span style="color: #ff0000;">&quot;INBOX&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;folder label=<span style="color: #ff0000;">&quot;Personal Folder&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                        <span style="color: #000000;">&lt;Pfolder label=<span style="color: #ff0000;">&quot;Business&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;Pfolder label=<span style="color: #ff0000;">&quot;Demo&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;Pfolder label=<span style="color: #ff0000;">&quot;Personal&quot;</span> isBranch=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;Pfolder label=<span style="color: #ff0000;">&quot;Saved Mail&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;/folder<span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;">&lt;folder label=<span style="color: #ff0000;">&quot;Sent&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;folder label=<span style="color: #ff0000;">&quot;Trash&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;">&lt;/folder<span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:XMLList</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:XMLListCollection</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Tree</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/Halo_Tree_borderSkin_test/bin/srcview/">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/spark/Halo_Tree_borderSkin_test/bin/main.html" width="100%" height="300"></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>Or, you can modify the Halo Tree border skin, 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>?<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/28/removing-the-border-from-the-halo-tree-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;Halo_Tree_borderSkin_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;">        backgroundColor=<span style="color: #ff0000;">&quot;red&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Tree</span> id=<span style="color: #ff0000;">&quot;tree1&quot;</span></span>
<span style="color: #000000;">            labelField=<span style="color: #ff0000;">&quot;@label&quot;</span></span>
<span style="color: #000000;">            showRoot=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #000000;">            borderSkin=<span style="color: #ff0000;">&quot;skins.CustomBorderSkin&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;160&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:XMLListCollection</span> id=<span style="color: #ff0000;">&quot;MailBox&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:XMLList</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;">&lt;folder label=<span style="color: #ff0000;">&quot;Mail&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;">&lt;folder label=<span style="color: #ff0000;">&quot;INBOX&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;folder label=<span style="color: #ff0000;">&quot;Personal Folder&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                        <span style="color: #000000;">&lt;Pfolder label=<span style="color: #ff0000;">&quot;Business&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;Pfolder label=<span style="color: #ff0000;">&quot;Demo&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;Pfolder label=<span style="color: #ff0000;">&quot;Personal&quot;</span> isBranch=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;Pfolder label=<span style="color: #ff0000;">&quot;Saved Mail&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;/folder<span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;">&lt;folder label=<span style="color: #ff0000;">&quot;Sent&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;folder label=<span style="color: #ff0000;">&quot;Trash&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;">&lt;/folder<span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:XMLList</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:XMLListCollection</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Tree</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>And the custom border skin, <em>skins/CustomBorderSkin.mxml</em>, is as follows:</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/28/removing-the-border-from-the-halo-tree-control-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;local:SparkSkinForHalo</span> name=<span style="color: #ff0000;">&quot;CustomBorderSkin&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:local=<span style="color: #ff0000;">&quot;mx.skins.spark.*&quot;</span></span>
<span style="color: #000000;">        implements=<span style="color: #ff0000;">&quot;mx.core.IRectangularBorder&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 mx.core.EdgeMetrics;</span>
<span style="color: #000000;">        import mx.core.IUIComponent;</span>
<span style="color: #000000;">        import mx.graphics.RectangularDropShadow;</span>
&nbsp;
<span style="color: #000000;">        /* Define the skin elements that should not be colorized. */</span>
<span style="color: #000000;">        static private const exclusions:Array = <span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;background&quot;</span><span style="color: #66cc66;">&#93;</span>;</span>
<span style="color: #000000;">        override public function get colorizeExclusions<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:Array <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">            return exclusions;</span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">        /* Define the content fill items that should be colored by the <span style="color: #ff0000;">&quot;contentBackgroundColor&quot;</span> style. */</span>
<span style="color: #000000;">        static private const contentFill:Array = <span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;bgFill&quot;</span><span style="color: #66cc66;">&#93;</span>;</span>
<span style="color: #000000;">        override public function get contentItems<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:Array <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">            return contentFill;</span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">        /* Define the border item. */</span>
<span style="color: #000000;">        static private const borderItem:Array = <span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span>;</span>
<span style="color: #000000;">        override protected function get borderItems<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:Array <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">            return borderItem;</span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">        override protected function get defaultBorderItemColor<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:uint <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">            return 0x696969;</span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">        static private const metrics:EdgeMetrics = new EdgeMetrics<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">        private var dropShadow:RectangularDropShadow;</span>
&nbsp;
<span style="color: #000000;">        public function get borderMetrics<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:EdgeMetrics <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">            return metrics;</span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">        public function get backgroundImageBounds<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:Rectangle <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">            return null;</span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">        public function set backgroundImageBounds<span style="color: #66cc66;">&#40;</span>value:Rectangle<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">        public function get hasBackgroundImage<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:Boolean <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">            return false;</span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">        public function layoutBackgroundImage<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">        override protected function updateDisplayList<span style="color: #66cc66;">&#40;</span>unscaledWidth:Number, unscaledHeight:Number<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">            graphics.clear<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">            super.updateDisplayList<span style="color: #66cc66;">&#40;</span>unscaledWidth, unscaledHeight<span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">            if <span style="color: #66cc66;">&#40;</span>parent &amp;&amp; parent is IUIComponent &amp;&amp; !IUIComponent<span style="color: #66cc66;">&#40;</span>parent<span style="color: #66cc66;">&#41;</span>.enabled<span style="color: #66cc66;">&#41;</span></span>
<span style="color: #000000;">                alpha = <span style="color: #cc66cc;">0.5</span>;</span>
<span style="color: #000000;">            else</span>
<span style="color: #000000;">                alpha = <span style="color: #cc66cc;">1</span>;</span>
&nbsp;
<span style="color: #000000;">            // Draw drop shadow, if needed</span>
<span style="color: #000000;">            if <span style="color: #66cc66;">&#40;</span>getStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;dropShadowEnabled&quot;</span><span style="color: #66cc66;">&#41;</span> == false ||</span>
<span style="color: #000000;">                getStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;dropShadowEnabled&quot;</span><span style="color: #66cc66;">&#41;</span> == <span style="color: #ff0000;">&quot;false&quot;</span> ||</span>
<span style="color: #000000;">                width == <span style="color: #cc66cc;">0</span> ||</span>
<span style="color: #000000;">                height == <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                return;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            // Create a RectangularDropShadow object, set its properties,</span>
<span style="color: #000000;">            // and draw the shadow</span>
<span style="color: #000000;">            if <span style="color: #66cc66;">&#40;</span>!dropShadow<span style="color: #66cc66;">&#41;</span></span>
<span style="color: #000000;">                dropShadow = new RectangularDropShadow<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">            dropShadow.distance = <span style="color: #cc66cc;">5</span>;</span>
<span style="color: #000000;">            dropShadow.angle = <span style="color: #cc66cc;">90</span>;</span>
<span style="color: #000000;">            dropShadow.color = <span style="color: #cc66cc;">0</span>;</span>
<span style="color: #000000;">            dropShadow.alpha = <span style="color: #cc66cc;">0.8</span>;</span>
<span style="color: #000000;">            dropShadow.blurX = <span style="color: #cc66cc;">20</span>;</span>
<span style="color: #000000;">            dropShadow.blurY = <span style="color: #cc66cc;">20</span>;</span>
&nbsp;
<span style="color: #000000;">            dropShadow.drawShadow<span style="color: #66cc66;">&#40;</span>graphics, x, y, width, height<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">        private function getDropShadowAngle<span style="color: #66cc66;">&#40;</span>distance:Number, direction:String<span style="color: #66cc66;">&#41;</span>:Number <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">            if <span style="color: #66cc66;">&#40;</span>direction == <span style="color: #ff0000;">&quot;left&quot;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                return distance <span style="color: #7400FF;">&gt;</span></span>= 0 ? 135 : 225;
            } else if (direction == &quot;right&quot;) {
                return distance &gt;= 0 ? 45 : 315;
            } else { // direction == &quot;center&quot;
                return distance &gt;= 0 ? 90 : 270;
            }
        }
        ]]&gt;
    <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:Group</span> left=<span style="color: #ff0000;">&quot;0&quot;</span> right=<span style="color: #ff0000;">&quot;0&quot;</span> top=<span style="color: #ff0000;">&quot;0&quot;</span> bottom=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- fill --&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> id=<span style="color: #ff0000;">&quot;background&quot;</span> left=<span style="color: #ff0000;">&quot;1&quot;</span> right=<span style="color: #ff0000;">&quot;1&quot;</span> top=<span style="color: #ff0000;">&quot;1&quot;</span> bottom=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SolidColor</span> id=<span style="color: #ff0000;">&quot;bgFill&quot;</span> color=<span style="color: #ff0000;">&quot;0xFFFFFF&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Group</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/local:SparkSkinForHalo</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p class="alert">The default Spark skins for the MX/Halo controls/containers can be found in the Flex SDK at:<br/>
<em>%Flex SDK%</em>\frameworks\projects\sparkskins\src\mx\skins\spark\*.</p>
<p>You can also set the <code>borderSkin</code> style in an external .CSS file or &lt;Style/&gt; block, 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>?<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/28/removing-the-border-from-the-halo-tree-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;Halo_Tree_borderSkin_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;fx:Style</span><span style="color: #7400FF;">&gt;</span></span>
        @namespace s &quot;library://ns.adobe.com/flex/spark&quot;;
        @namespace mx &quot;library://ns.adobe.com/flex/halo&quot;;
&nbsp;
        mx|Tree {
            /* borderSkin: ClassReference(null); */
            borderSkin: ClassReference(&quot;skins.CustomBorderSkin&quot;);
        }
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Style</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Tree</span> id=<span style="color: #ff0000;">&quot;tree1&quot;</span></span>
<span style="color: #000000;">            labelField=<span style="color: #ff0000;">&quot;@label&quot;</span></span>
<span style="color: #000000;">            showRoot=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;160&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:XMLListCollection</span> id=<span style="color: #ff0000;">&quot;MailBox&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:XMLList</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;">&lt;folder label=<span style="color: #ff0000;">&quot;Mail&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;">&lt;folder label=<span style="color: #ff0000;">&quot;INBOX&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;folder label=<span style="color: #ff0000;">&quot;Personal Folder&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                        <span style="color: #000000;">&lt;Pfolder label=<span style="color: #ff0000;">&quot;Business&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;Pfolder label=<span style="color: #ff0000;">&quot;Demo&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;Pfolder label=<span style="color: #ff0000;">&quot;Personal&quot;</span> isBranch=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;Pfolder label=<span style="color: #ff0000;">&quot;Saved Mail&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;/folder<span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;">&lt;folder label=<span style="color: #ff0000;">&quot;Sent&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;folder label=<span style="color: #ff0000;">&quot;Trash&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;">&lt;/folder<span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:XMLList</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:XMLListCollection</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Tree</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>Or, you can set the <code>borderSkin</code> style using ActionScript, 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>?<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/28/removing-the-border-from-the-halo-tree-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;Halo_Tree_borderSkin_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;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 skins.CustomBorderSkin;</span>
&nbsp;
<span style="color: #000000;">            protected function btn_click<span style="color: #66cc66;">&#40;</span>evt:MouseEvent<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                tree1.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;borderSkin&quot;</span>, CustomBorderSkin<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:Button</span> id=<span style="color: #ff0000;">&quot;btn&quot;</span></span>
<span style="color: #000000;">            label=<span style="color: #ff0000;">&quot;Set Tree border skin&quot;</span></span>
<span style="color: #000000;">            click=<span style="color: #ff0000;">&quot;btn_click(event);&quot;</span></span>
<span style="color: #000000;">            left=<span style="color: #ff0000;">&quot;10&quot;</span> top=<span style="color: #ff0000;">&quot;10&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Tree</span> id=<span style="color: #ff0000;">&quot;tree1&quot;</span></span>
<span style="color: #000000;">            labelField=<span style="color: #ff0000;">&quot;@label&quot;</span></span>
<span style="color: #000000;">            showRoot=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;160&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:XMLListCollection</span> id=<span style="color: #ff0000;">&quot;MailBox&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:XMLList</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;">&lt;folder label=<span style="color: #ff0000;">&quot;Mail&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;">&lt;folder label=<span style="color: #ff0000;">&quot;INBOX&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;folder label=<span style="color: #ff0000;">&quot;Personal Folder&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                        <span style="color: #000000;">&lt;Pfolder label=<span style="color: #ff0000;">&quot;Business&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;Pfolder label=<span style="color: #ff0000;">&quot;Demo&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;Pfolder label=<span style="color: #ff0000;">&quot;Personal&quot;</span> isBranch=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;Pfolder label=<span style="color: #ff0000;">&quot;Saved Mail&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;/folder<span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;">&lt;folder label=<span style="color: #ff0000;">&quot;Sent&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;folder label=<span style="color: #ff0000;">&quot;Trash&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;">&lt;/folder<span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:XMLList</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:XMLListCollection</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Tree</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: 'Removing the border from the Halo Tree control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/08/28/removing-the-border-from-the-halo-tree-control-in-flex-4/',contentID: 'post-1759',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'borderSkin,Gumbo',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/28/removing-the-border-from-the-halo-tree-control-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Opening branches by clicking rows in a Tree control in Flex</title>
		<link>http://blog.flexexamples.com/2008/04/05/opening-branches-by-clicking-rows-in-a-tree-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/04/05/opening-branches-by-clicking-rows-in-a-tree-control-in-flex/#comments</comments>
		<pubDate>Sat, 05 Apr 2008 15:59:18 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Tree]]></category>
		<category><![CDATA[dataDescriptor]]></category>
		<category><![CDATA[expandItem()]]></category>
		<category><![CDATA[getChildren()]]></category>
		<category><![CDATA[isBranch]]></category>
		<category><![CDATA[isItemOpen()]]></category>
		<category><![CDATA[itemClick]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/04/05/opening-branches-by-clicking-rows-in-a-tree-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can expand/collapse branches in a Flex Tree control by clicking on the row instead of having to click on the disclosure/arrow icon.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2008/04/05/opening-branches-by-clicking-rows-in-a-tree-control-in-flex/ --&#62; &#60;mx:Application name=&#34;Tree_itemClick_test&#34; xmlns:mx=&#34;http://www.adobe.com/2006/mxml&#34; layout=&#34;vertical&#34; verticalAlign=&#34;middle&#34; backgroundColor=&#34;white&#34;&#62; &#160; &#60;mx:Script&#62; &#60;![CDATA[ import mx.collections.ICollectionView; import mx.events.ListEvent; &#160; private function tree_itemClick(evt:ListEvent):void { var item:Object [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can expand/collapse branches in a Flex Tree control by clicking on the row instead of having to click on the disclosure/arrow icon.</p>
<p><span id="more-588"></span></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/2008/04/05/opening-branches-by-clicking-rows-in-a-tree-control-in-flex/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> name=<span style="color: #ff0000;">&quot;Tree_itemClick_test&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span></span>
<span style="color: #000000;">        layout=<span style="color: #ff0000;">&quot;vertical&quot;</span></span>
<span style="color: #000000;">        verticalAlign=<span style="color: #ff0000;">&quot;middle&quot;</span></span>
<span style="color: #000000;">        backgroundColor=<span style="color: #ff0000;">&quot;white&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #339933;">&lt;mx:Script&gt;</span>
<span style="color: #339933;">        &lt;![CDATA[</span>
<span style="color: #339933;">            import mx.collections.ICollectionView;</span>
<span style="color: #339933;">            import mx.events.ListEvent;</span>
&nbsp;
<span style="color: #339933;">            private function tree_itemClick(evt:ListEvent):void {</span>
<span style="color: #339933;">                var item:Object = Tree(evt.currentTarget).selectedItem;</span>
<span style="color: #339933;">                if (tree.dataDescriptor.isBranch(item)) {</span>
<span style="color: #339933;">                    tree.expandItem(item, !tree.isItemOpen(item), true);</span>
<span style="color: #339933;">                }</span>
<span style="color: #339933;">            }</span>
&nbsp;
<span style="color: #339933;">            private function tree_labelFunc(item:XML):String {</span>
<span style="color: #339933;">                var children:ICollectionView;</span>
<span style="color: #339933;">                var suffix:String = &quot;&quot;;</span>
<span style="color: #339933;">                if (tree.dataDescriptor.isBranch(item)) {</span>
<span style="color: #339933;">                    children = tree.dataDescriptor.getChildren(item);</span>
<span style="color: #339933;">                    suffix = &quot; (&quot; + children.length + &quot;)&quot;;</span>
<span style="color: #339933;">                }</span>
<span style="color: #339933;">                return item[tree.labelField] + suffix;</span>
<span style="color: #339933;">            }</span>
<span style="color: #339933;">        ]]&gt;</span>
<span style="color: #339933;">    &lt;/mx:Script&gt;</span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:XML</span> id=<span style="color: #ff0000;">&quot;dp&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;">&lt;root<span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;">&lt;folder label=<span style="color: #ff0000;">&quot;One&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;">&lt;folder label=<span style="color: #ff0000;">&quot;One.A&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;">&lt;item label=<span style="color: #ff0000;">&quot;One.A.1&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;item label=<span style="color: #ff0000;">&quot;One.A.2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;item label=<span style="color: #ff0000;">&quot;One.A.3&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;item label=<span style="color: #ff0000;">&quot;One.A.4&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;item label=<span style="color: #ff0000;">&quot;One.A.5&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;">&lt;/folder<span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;">&lt;item label=<span style="color: #ff0000;">&quot;One.1&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;">&lt;item label=<span style="color: #ff0000;">&quot;One.2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;">&lt;/folder<span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;">&lt;folder label=<span style="color: #ff0000;">&quot;Two&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;">&lt;item label=<span style="color: #ff0000;">&quot;Two.1&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;">&lt;folder label=<span style="color: #ff0000;">&quot;Two.A&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;">&lt;item label=<span style="color: #ff0000;">&quot;Two.A.1&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;item label=<span style="color: #ff0000;">&quot;Two.A.2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;">&lt;/folder<span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;">&lt;/folder<span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;">&lt;/root<span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:XML</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Tree</span> id=<span style="color: #ff0000;">&quot;tree&quot;</span></span>
<span style="color: #000000;">            dataProvider=<span style="color: #ff0000;">&quot;{dp}&quot;</span></span>
<span style="color: #000000;">            showRoot=<span style="color: #ff0000;">&quot;false&quot;</span></span>
<span style="color: #000000;">            labelField=<span style="color: #ff0000;">&quot;@label&quot;</span></span>
<span style="color: #000000;">            labelFunction=<span style="color: #ff0000;">&quot;tree_labelFunc&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;300&quot;</span></span>
<span style="color: #000000;">            rowCount=<span style="color: #ff0000;">&quot;6&quot;</span></span>
<span style="color: #000000;">            itemClick=<span style="color: #ff0000;">&quot;tree_itemClick(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Tree_expandItem_test_2/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_expandItem_test_2/bin/main.html" width="100%" height="200"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Opening branches by clicking rows in a Tree control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/04/05/opening-branches-by-clicking-rows-in-a-tree-control-in-flex/',contentID: 'post-588',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'dataDescriptor,expandItem(),getChildren(),isBranch,isItemOpen(),itemClick',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/04/05/opening-branches-by-clicking-rows-in-a-tree-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>29</slash:comments>
		</item>
		<item>
		<title>Creating a simple image gallery with the Flex Tree control</title>
		<link>http://blog.flexexamples.com/2008/04/04/creating-a-simple-image-gallery-with-the-flex-tree-control/</link>
		<comments>http://blog.flexexamples.com/2008/04/04/creating-a-simple-image-gallery-with-the-flex-tree-control/#comments</comments>
		<pubDate>Sat, 05 Apr 2008 01:31:52 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[SWFLoader]]></category>
		<category><![CDATA[Tree]]></category>
		<category><![CDATA[dataDescriptor]]></category>
		<category><![CDATA[hasOwnProperty()]]></category>
		<category><![CDATA[isBranch]]></category>
		<category><![CDATA[itemRenderer]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/04/04/creating-a-simple-image-gallery-with-the-flex-tree-control/</guid>
		<description><![CDATA[<p>The following example shows how you can create a simple image gallery in Flex using a Tree control and a SWFLoader control.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Tree_gallery_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/04/04/creating-a-simple-image-gallery-with-the-flex-tree-control/ --&#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.ListEvent; private function tree_itemClick(evt:ListEvent):void { var t:Tree = evt.currentTarget [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can create a simple image gallery in Flex using a Tree control and a SWFLoader control.</p>
<p>Full code after the jump.</p>
<p><span id="more-587"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Tree_gallery_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/04/04/creating-a-simple-image-gallery-with-the-flex-tree-control/ --&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.ListEvent;

            private function tree_itemClick(evt:ListEvent):void {
                var t:Tree = evt.currentTarget as Tree;
                var dataObj:Object = evt.itemRenderer.data;
                if (dataObj.hasOwnProperty("@src")) {
                    swfLoader.source = dataObj.@src;
                } else if (t.dataDescriptor.isBranch(t.selectedItem)) {
                    swfLoader.source = null;
                    panel.status = "";
                }
            }

            private function tree_labelFunc(item:Object):String {
                var suffix:String = "";
                if (tree.dataDescriptor.isBranch(item)) {
                    suffix = " (" + item.children().length() + ")";
                }
                return item.@label + suffix;
            }

            private function swfLoader_complete(evt:Event):void {
                panel.status = (swfLoader.bytesTotal/1024).toFixed(2) + 'KB';
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:XML id="dp" source="data/dp.xml" /&gt;

    &lt;mx:HDividedBox width="100%" height="100%"&gt;
        &lt;mx:Panel width="200" height="100%"&gt;
            &lt;mx:Tree id="tree"
                    dataProvider="{dp}"
                    labelFunction="tree_labelFunc"
                    showRoot="false"
                    width="100%"
                    height="100%"
                    itemClick="tree_itemClick(event);" /&gt;
        &lt;/mx:Panel&gt;
        &lt;mx:Panel id="panel"
                width="100%"
                height="100%"
                backgroundColor="white"&gt;
            &lt;mx:SWFLoader id="swfLoader"
                    scaleContent="true"
                    width="100%"
                    height="100%"
                    complete="swfLoader_complete(event);" /&gt;
            &lt;mx:ControlBar&gt;
                &lt;mx:LinkButton label="{swfLoader.source.toString()}" /&gt;
            &lt;/mx:ControlBar&gt;
        &lt;/mx:Panel&gt;
    &lt;/mx:HDividedBox&gt;

&lt;/mx:Application&gt;
</pre>
<p class="download">data/dp.xml</p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/04/04/creating-a-simple-image-gallery-with-the-flex-tree-control/ --&gt;
&lt;root&gt;
    &lt;gallery label="RIA"&gt;
        &lt;file label="ColdFusion" src="assets/cf_appicon.jpg" /&gt;
        &lt;file label="Dreamweaver" src="assets/dw_appicon.jpg" /&gt;
        &lt;file label="Flash" src="assets/fl_appicon.jpg" /&gt;
        &lt;file label="Flash Player" src="assets/fl_player_appicon.jpg" /&gt;
        &lt;file label="Flex" src="assets/fx_appicon.jpg" /&gt;
    &lt;/gallery&gt;
&lt;/root&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Tree_gallery_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_gallery_test/bin/main.html" width="100%" height="500"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Creating a simple image gallery with the Flex Tree control on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/04/04/creating-a-simple-image-gallery-with-the-flex-tree-control/',contentID: 'post-587',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'dataDescriptor,hasOwnProperty(),isBranch,itemRenderer',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/04/04/creating-a-simple-image-gallery-with-the-flex-tree-control/feed/</wfw:commentRss>
		<slash:comments>32</slash:comments>
		</item>
		<item>
		<title>Displaying a Tree control as a pop up for a Flex PopUpButton control</title>
		<link>http://blog.flexexamples.com/2008/02/26/displaying-a-tree-control-as-a-pop-up-for-a-flex-popupbutton-control/</link>
		<comments>http://blog.flexexamples.com/2008/02/26/displaying-a-tree-control-as-a-pop-up-for-a-flex-popupbutton-control/#comments</comments>
		<pubDate>Tue, 26 Feb 2008 19:24:35 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[PopUpButton]]></category>
		<category><![CDATA[Tree]]></category>
		<category><![CDATA[popUp]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/02/26/displaying-a-tree-control-as-a-pop-up-for-a-flex-popupbutton-control/</guid>
		<description><![CDATA[<p>The following example shows how you can use a Tree control as a PopUpButton control&#8217;s pop up in Flex.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/PopUpButton_popUp_Tree_test/main.mxml">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/02/26/displaying-a-tree-control-as-a-pop-up-for-a-flex-popupbutton-control/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:Style&#62; Tree { textAlign: left; fontWeight: normal; } &#60;/mx:Style&#62; &#60;mx:XML id="mlb" source="mlb.xml" /&#62; &#60;mx:ApplicationControlBar dock="true"&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can use a Tree control as a PopUpButton control&#8217;s pop up in Flex.</p>
<p>Full code after the jump.</p>
<p><span id="more-530"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/PopUpButton_popUp_Tree_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/26/displaying-a-tree-control-as-a-pop-up-for-a-flex-popupbutton-control/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        Tree {
            textAlign: left;
            fontWeight: normal;
        }
    &lt;/mx:Style&gt;

    &lt;mx:XML id="mlb" source="mlb.xml" /&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:PopUpButton label="Please select a team..."&gt;
            &lt;mx:popUp&gt;
                &lt;mx:Tree id="tree"
                        dataProvider="{mlb}"
                        labelField="@label"
                        showRoot="false"
                        width="200"
                        rowCount="8" /&gt;
            &lt;/mx:popUp&gt;
        &lt;/mx:PopUpButton&gt;
    &lt;/mx:ApplicationControlBar&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/PopUpButton_popUp_Tree_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/PopUpButton_popUp_Tree_test/bin/main.html" width="100%" height="250"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Displaying a Tree control as a pop up for a Flex PopUpButton control on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/02/26/displaying-a-tree-control-as-a-pop-up-for-a-flex-popupbutton-control/',contentID: 'post-530',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'popUp',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/26/displaying-a-tree-control-as-a-pop-up-for-a-flex-popupbutton-control/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Removing leaf icons from the Flex Tree control</title>
		<link>http://blog.flexexamples.com/2008/01/25/removing-leaf-icons-from-the-flex-tree-control/</link>
		<comments>http://blog.flexexamples.com/2008/01/25/removing-leaf-icons-from-the-flex-tree-control/#comments</comments>
		<pubDate>Sat, 26 Jan 2008 07:51:21 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Tree]]></category>
		<category><![CDATA[defaultLeafIcon]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/25/removing-leaf-icons-from-the-flex-tree-control/</guid>
		<description><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2008/01/25/removing-folder-icons-from-the-flex-tree-control/">&#8220;Removing folder icons from the Flex Tree control&#8221;</a>, we saw how to remove the folder icons from a Tree control in Flex so only the disclosure (arrow) icons were visible. In the following example we look at a similar technique for removing the default leaf icons from the Tree control [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2008/01/25/removing-folder-icons-from-the-flex-tree-control/">&#8220;Removing folder icons from the Flex Tree control&#8221;</a>, we saw how to remove the folder icons from a Tree control in Flex so only the disclosure (arrow) icons were visible. In the following example we look at a similar technique for removing the default leaf icons from the Tree control in Flex.</p>
<p>The short answer, set the <code>defaultLeafIcon</code> style to null using CSS, as shown in the following snippet:</p>
<pre class="code">
&lt;mx:Style&gt;
    Tree {
        defaultLeafIcon: ClassReference(null);
    }
&lt;/mx:Style&gt;
</pre>
<p>The long answer? Keep reading!</p>
<p>Full code after the jump.</p>
<p><span id="more-480"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Tree_defaultLeafIcon_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/25/removing-leaf-icons-from-the-flex-tree-control/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:XML id="dp"&gt;
        &lt;mlb&gt;
            &lt;league label="American League"&gt;
                &lt;division label="East"&gt;
                    &lt;team label="Boston" /&gt;
                    &lt;team label="New York" /&gt;
                    &lt;team label="Toronto" /&gt;
                    &lt;team label="Baltimore" /&gt;
                    &lt;team label="Tampa Bay" /&gt;
                &lt;/division&gt;
                &lt;division label="Central"&gt;
                    &lt;team label="Cleveland" /&gt;
                    &lt;team label="Detroit" /&gt;
                    &lt;team label="Minnesota" /&gt;
                    &lt;team label="Chicago" /&gt;
                    &lt;team label="Kansas City" /&gt;
                &lt;/division&gt;
                &lt;division label="West"&gt;
                    &lt;team label="Los Angeles" /&gt;
                    &lt;team label="Seattle" /&gt;
                    &lt;team label="Oakland" /&gt;
                    &lt;team label="Texas" /&gt;
                &lt;/division&gt;
            &lt;/league&gt;
        &lt;/mlb&gt;
    &lt;/mx:XML&gt;

    &lt;mx:Style&gt;
        Tree {
            defaultLeafIcon: ClassReference(null);
        }
    &lt;/mx:Style&gt;

    &lt;mx:Tree id="tree"
            dataProvider="{dp.league}"
            labelField="@label"
            iconField="@icon"
            showRoot="true"
            width="320"
            rowCount="9" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Tree_defaultLeafIcon_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_defaultLeafIcon_test/bin/main.html" width="100%" height="300"></iframe></p>
<p>If you want to set the <code>defaultLeafIcon</code> style to null in MXML, you could use the following snippet:</p>
<pre class="code">
&lt;mx:Tree id=&quot;tree&quot;
        dataProvider=&quot;{dp.league}&quot;
        <strong style="color:red;">defaultLeafIcon=&quot;{null}&quot;</strong>
        labelField=&quot;@label&quot;
        iconField=&quot;@icon&quot;
        showRoot=&quot;true&quot;
        width=&quot;320&quot;
        rowCount=&quot;9&quot; /&gt;
</pre>
<p>Or, if you want to set the <code>defaultLeafIcon</code> style in ActionScript, you could use the following snippet:</p>
<pre class="code">
&lt;mx:Tree id=&quot;tree&quot;
        dataProvider=&quot;{dp.league}&quot;
        labelField=&quot;@label&quot;
        iconField=&quot;@icon&quot;
        showRoot=&quot;true&quot;
        width=&quot;320&quot;
        rowCount=&quot;9&quot;
        <strong style="color:red;">initialize=&quot;tree.setStyle(&#39;defaultLeafIcon&#39;, null);&quot;</strong> /&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Removing leaf icons from the Flex Tree control on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/01/25/removing-leaf-icons-from-the-flex-tree-control/',contentID: 'post-480',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'defaultLeafIcon',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/25/removing-leaf-icons-from-the-flex-tree-control/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Removing folder icons from the Flex Tree control</title>
		<link>http://blog.flexexamples.com/2008/01/25/removing-folder-icons-from-the-flex-tree-control/</link>
		<comments>http://blog.flexexamples.com/2008/01/25/removing-folder-icons-from-the-flex-tree-control/#comments</comments>
		<pubDate>Fri, 25 Jan 2008 08:19:13 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Tree]]></category>
		<category><![CDATA[folderClosedIcon]]></category>
		<category><![CDATA[folderOpenIcon]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/25/removing-folder-icons-from-the-flex-tree-control/</guid>
		<description><![CDATA[<p>The following example shows how you can remove the folder icons from the Tree control in Flex so that only the disclosure (arrow) icons and leaf icons are visible.</p> <p>The short answer, set the folderClosedIcon and folderOpenIcon styles to null using CSS, as shown in the following snippet:</p> &#60;mx:Style&#62; Tree { folderClosedIcon: ClassReference(null); folderOpenIcon: ClassReference(null); [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can remove the folder icons from the Tree control in Flex so that only the disclosure (arrow) icons and leaf icons are visible.</p>
<p>The short answer, set the <code>folderClosedIcon</code> and <code>folderOpenIcon</code> styles to null using CSS, as shown in the following snippet:</p>
<pre class="code">
&lt;mx:Style&gt;
    Tree {
        folderClosedIcon: ClassReference(null);
        folderOpenIcon: ClassReference(null);
    }
&lt;/mx:Style&gt;
</pre>
<p>The long answer?<br />
Full code after the jump.</p>
<p><span id="more-476"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Tree_folderClosedIcon_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/25/removing-folder-icons-from-the-flex-tree-control/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:XML id="dp"&gt;
        &lt;mlb&gt;
            &lt;league label="American League"&gt;
                &lt;division label="East"&gt;
                    &lt;team label="Boston" /&gt;
                    &lt;team label="New York" /&gt;
                    &lt;team label="Toronto" /&gt;
                    &lt;team label="Baltimore" /&gt;
                    &lt;team label="Tampa Bay" /&gt;
                &lt;/division&gt;
                &lt;division label="Central"&gt;
                    &lt;team label="Cleveland" /&gt;
                    &lt;team label="Detroit" /&gt;
                    &lt;team label="Minnesota" /&gt;
                    &lt;team label="Chicago" /&gt;
                    &lt;team label="Kansas City" /&gt;
                &lt;/division&gt;
                &lt;division label="West"&gt;
                    &lt;team label="Los Angeles" /&gt;
                    &lt;team label="Seattle" /&gt;
                    &lt;team label="Oakland" /&gt;
                    &lt;team label="Texas" /&gt;
                &lt;/division&gt;
            &lt;/league&gt;
        &lt;/mlb&gt;
    &lt;/mx:XML&gt;

    &lt;mx:Style&gt;
        Tree {
            folderClosedIcon: ClassReference(null);
            folderOpenIcon: ClassReference(null);
        }
    &lt;/mx:Style&gt;

    &lt;mx:Tree id="TreeProject"
            dataProvider="{dp.league}"
            labelField="@label"
            iconField="@icon"
            showRoot="true"
            width="320"
            rowCount="9" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Tree_folderClosedIcon_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_folderClosedIcon_test/bin/main.html" width="100%" height="300"></iframe></p>
<p class="new">For an example of removing leaf icons from the Tree control in Flex, see <a href="http://blog.flexexamples.com/2008/01/25/removing-leaf-icons-from-the-flex-tree-control/">&#8220;Removing leaf icons from the Flex Tree control&#8221;</a>.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Removing folder icons from the Flex Tree control on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/01/25/removing-folder-icons-from-the-flex-tree-control/',contentID: 'post-476',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'folderClosedIcon,folderOpenIcon',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/25/removing-folder-icons-from-the-flex-tree-control/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Preventing specific items from being selected in a Flex Tree control</title>
		<link>http://blog.flexexamples.com/2008/01/16/preventing-specific-items-from-being-selected-in-a-flex-tree-control/</link>
		<comments>http://blog.flexexamples.com/2008/01/16/preventing-specific-items-from-being-selected-in-a-flex-tree-control/#comments</comments>
		<pubDate>Thu, 17 Jan 2008 07:58:43 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Tree]]></category>
		<category><![CDATA[hasOwnProperty()]]></category>
		<category><![CDATA[itemClick]]></category>
		<category><![CDATA[selectedItem]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/16/preventing-specific-items-from-being-selected-in-a-flex-tree-control/</guid>
		<description><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2008/01/16/preventing-branches-from-being-selected-in-a-flex-tree-control/">&#8220;Preventing branches from being selected in a Flex Tree control&#8221;</a>, we saw how we could prevent users from selecting branches (folders) in a Tree container in Flex by using the itemClick event and the Tree class&#8217;s dataDescriptor.isBranch() method.</p> <p>The following example shows you how you can prevent any item from [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2008/01/16/preventing-branches-from-being-selected-in-a-flex-tree-control/">&#8220;Preventing branches from being selected in a Flex Tree control&#8221;</a>, we saw how we could prevent users from selecting branches (folders) in a Tree container in Flex by using the itemClick event and the Tree class&#8217;s <code>dataDescriptor.isBranch()</code> method.</p>
<p>The following example shows you how you can prevent <em>any</em> item from being selected by adding an attribute (named &#8220;clickable&#8221;, but you could name it anything you wanted) and using E4X expressions to determine if the currently clicked item should be selectable or not.</p>
<p>Full code after the jump.</p>
<p><span id="more-461"></span></p>
<p>Note that in the following example, items with the &#8220;(X)&#8221; suffix are not-selectable, only the following nodes should be selectable: &#8220;Grandchild 1&#8243;, &#8220;Grandchild 2&#8243;, and &#8220;Child 4&#8243;.</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Tree_selectedItem_test_2/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/16/preventing-specific-items-from-being-selected-in-a-flex-tree-control/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"
        creationComplete="init();"&gt;

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

            private function init():void {
                tree.openItems = dp..node;
            }

            private function tree_itemClick(evt:ListEvent):void {
                var item:Object = evt.currentTarget.selectedItem;
                var nonSelectable:Boolean = ((item.hasOwnProperty("@clickable")) &#038;&#038; (item.(@clickable == "false")));
                if (nonSelectable) {
                    tree.selectedItem = null;
                }
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:XML id="dp"&gt;
        &lt;root&gt;
            &lt;node label="Parent 1 (X)" clickable="false"&gt;
                &lt;node label="Child 1 (X)" clickable="false" /&gt;
                &lt;node label="Child 2 (X)" clickable="false"&gt;
                    &lt;node label="Grandchild 1" /&gt;
                    &lt;node label="Grandchild 2" /&gt;
                &lt;/node&gt;
                &lt;node label="Child 3 (X)" clickable="false" /&gt;
                &lt;node label="Child 4" /&gt;
            &lt;/node&gt;
        &lt;/root&gt;
    &lt;/mx:XML&gt;

    &lt;mx:Tree id="tree"
            dataProvider="{dp}"
            showRoot="false"
            labelField="@label"
            width="200"
            itemClick="tree_itemClick(event);" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Tree_selectedItem_test_2/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_selectedItem_test_2/bin/main.html" width="100%" height="250"></iframe></p>
<p class="construction">For more information on disabling list selection in the List/Tree/ComboBox controls, see Alex Harui&#8217;s excellent blog entry, <a href="http://blogs.adobe.com/aharui/2007/06/disabling_list_selection.html">&#8220;Disabling List Selection&#8221;</a>.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Preventing specific items from being selected in a Flex Tree control on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/01/16/preventing-specific-items-from-being-selected-in-a-flex-tree-control/',contentID: 'post-461',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'hasOwnProperty(),itemClick,selectedItem',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/16/preventing-specific-items-from-being-selected-in-a-flex-tree-control/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Preventing branches from being selected in a Flex Tree control</title>
		<link>http://blog.flexexamples.com/2008/01/16/preventing-branches-from-being-selected-in-a-flex-tree-control/</link>
		<comments>http://blog.flexexamples.com/2008/01/16/preventing-branches-from-being-selected-in-a-flex-tree-control/#comments</comments>
		<pubDate>Thu, 17 Jan 2008 04:48:02 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Tree]]></category>
		<category><![CDATA[dataDescriptor]]></category>
		<category><![CDATA[isBranch]]></category>
		<category><![CDATA[itemClick]]></category>
		<category><![CDATA[selectedItem]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/16/preventing-branches-from-being-selected-in-a-flex-tree-control/</guid>
		<description><![CDATA[<p>The following example shows you how you can prevent users from selecting the branch (folder) items in a Tree control in Flex by listening for the itemClick event and using the Tree class&#8217;s dataDescriptor.isBranch() method to determine whether the currently selected item is a branch, and if so, deselect the item.</p> <p>Full code after the [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows you how you can prevent users from selecting the branch (folder) items in a Tree control in Flex by listening for the <code>itemClick</code> event and using the Tree class&#8217;s <code>dataDescriptor.isBranch()</code> method to determine whether the currently selected item is a branch, and if so, deselect the item.</p>
<p>Full code after the jump.</p>
<p><span id="more-460"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Tree_selectedItem_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/16/preventing-branches-from-being-selected-in-a-flex-tree-control/ --&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.ListEvent;

            private function tree_itemClick(evt:ListEvent):void {
                var item:Object = evt.currentTarget.selectedItem
                if (tree.dataDescriptor.isBranch(item)) {
                    tree.selectedItem = null;
                }
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:XML id="dp"&gt;
        &lt;root&gt;
            &lt;node label="Parent 1"&gt;
                &lt;node label="Child 1" /&gt;
                &lt;node label="Child 2"&gt;
                    &lt;node label="Grandchild 1" /&gt;
                    &lt;node label="Grandchild 2" /&gt;
                &lt;/node&gt;
                &lt;node label="Child 3" /&gt;
                &lt;node label="Child 4" /&gt;
            &lt;/node&gt;
        &lt;/root&gt;
    &lt;/mx:XML&gt;

    &lt;mx:Tree id="tree"
            dataProvider="{dp}"
            showRoot="false"
            labelField="@label"
            width="200"
            itemClick="tree_itemClick(event);" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Tree_selectedItem_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_selectedItem_test/bin/main.html" width="100%" height="250"></iframe></p>
<p class="construction">For more information on disabling list selection in the List/Tree/ComboBox controls, see Alex Harui&#8217;s excellent blog entry, <a href="http://blogs.adobe.com/aharui/2007/06/disabling_list_selection.html">&#8220;Disabling List Selection&#8221;</a>.</p>
<p class="new">For another example, see <a href="http://blog.flexexamples.com/2008/01/16/preventing-specific-items-from-being-selected-in-a-flex-tree-control/">&#8220;Preventing specific items from being selected in a Flex Tree control&#8221;</a>.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Preventing branches from being selected in a Flex Tree control on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/01/16/preventing-branches-from-being-selected-in-a-flex-tree-control/',contentID: 'post-460',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'dataDescriptor,isBranch,itemClick,selectedItem',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/16/preventing-branches-from-being-selected-in-a-flex-tree-control/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Expanding nodes in a Flex Tree control using the openItems property</title>
		<link>http://blog.flexexamples.com/2008/01/15/expanding-nodes-in-a-flex-tree-control-using-the-openitems-property/</link>
		<comments>http://blog.flexexamples.com/2008/01/15/expanding-nodes-in-a-flex-tree-control-using-the-openitems-property/#comments</comments>
		<pubDate>Wed, 16 Jan 2008 03:34:10 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Tree]]></category>
		<category><![CDATA[openItems]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/15/expanding-nodes-in-a-flex-tree-control-using-the-openitems-property/</guid>
		<description><![CDATA[<p>The following example shows how you can open nodes in a Tree control in Flex by setting the openItems property to an XMLList or Array object.</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/2008/01/15/expanding-nodes-in-a-flex-tree-control-using-the-openitems-property/ --&#62; &#60;mx:Application name=&#34;Tree_openItems_test&#34; xmlns:mx=&#34;http://www.adobe.com/2006/mxml&#34; layout=&#34;vertical&#34; verticalAlign=&#34;middle&#34; backgroundColor=&#34;white&#34;&#62; &#160; &#60;mx:Script&#62; &#60;![CDATA[ private function openAllNodes():void { tree.openItems = dp..node; } [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can open nodes in a Tree control in Flex by setting the <code>openItems</code> property to an XMLList or Array object.</p>
<p>Full code after the jump.</p>
<p><span id="more-454"></span></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/2008/01/15/expanding-nodes-in-a-flex-tree-control-using-the-openitems-property/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> name=<span style="color: #ff0000;">&quot;Tree_openItems_test&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span></span>
<span style="color: #000000;">        layout=<span style="color: #ff0000;">&quot;vertical&quot;</span></span>
<span style="color: #000000;">        verticalAlign=<span style="color: #ff0000;">&quot;middle&quot;</span></span>
<span style="color: #000000;">        backgroundColor=<span style="color: #ff0000;">&quot;white&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #339933;">&lt;mx:Script&gt;</span>
<span style="color: #339933;">        &lt;![CDATA[</span>
<span style="color: #339933;">            private function openAllNodes():void {</span>
<span style="color: #339933;">                tree.openItems = dp..node;</span>
<span style="color: #339933;">            }</span>
&nbsp;
<span style="color: #339933;">            private function closeAllNodes():void {</span>
<span style="color: #339933;">                tree.openItems = [];</span>
<span style="color: #339933;">            }</span>
<span style="color: #339933;">        ]]&gt;</span>
<span style="color: #339933;">    &lt;/mx:Script&gt;</span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:XML</span> id=<span style="color: #ff0000;">&quot;dp&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;">&lt;root<span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;">&lt;node label=<span style="color: #ff0000;">&quot;Parent 1&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;">&lt;node label=<span style="color: #ff0000;">&quot;Child 1&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;">&lt;node label=<span style="color: #ff0000;">&quot;Child 2&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;">&lt;node label=<span style="color: #ff0000;">&quot;Grandchild 1&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;node label=<span style="color: #ff0000;">&quot;Grandchild 2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;">&lt;/node<span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;">&lt;node label=<span style="color: #ff0000;">&quot;Child 3&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;">&lt;node label=<span style="color: #ff0000;">&quot;Child 4&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;">&lt;/node<span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;">&lt;/root<span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:XML</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ApplicationControlBar</span> dock=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Button</span> label=<span style="color: #ff0000;">&quot;Open all nodes&quot;</span> click=<span style="color: #ff0000;">&quot;openAllNodes();&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Button</span> label=<span style="color: #ff0000;">&quot;Close all nodes&quot;</span> click=<span style="color: #ff0000;">&quot;closeAllNodes();&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ApplicationControlBar</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Tree</span> id=<span style="color: #ff0000;">&quot;tree&quot;</span></span>
<span style="color: #000000;">            dataProvider=<span style="color: #ff0000;">&quot;{dp}&quot;</span></span>
<span style="color: #000000;">            showRoot=<span style="color: #ff0000;">&quot;false&quot;</span></span>
<span style="color: #000000;">            labelField=<span style="color: #ff0000;">&quot;@label&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;200&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Tree_openItems_test_2/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_openItems_test_2/bin/main.html" width="100%" height="300"></iframe></p>
<p class="information">You can tweak the previous E4X statement by only returning nodes that have children: <code>dp..node.(children().length() &gt; 0);</code>.</p>
<p>The following example uses a bit more of a complex E4X statement to find data provider XML nodes with a specific attribute, &#8220;isOpen&#8221;, and only opens those nodes.</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/2008/01/15/expanding-nodes-in-a-flex-tree-control-using-the-openitems-property/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> name=<span style="color: #ff0000;">&quot;Tree_openItems_test&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span></span>
<span style="color: #000000;">        layout=<span style="color: #ff0000;">&quot;vertical&quot;</span></span>
<span style="color: #000000;">        verticalAlign=<span style="color: #ff0000;">&quot;middle&quot;</span></span>
<span style="color: #000000;">        backgroundColor=<span style="color: #ff0000;">&quot;white&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #339933;">&lt;mx:Script&gt;</span>
<span style="color: #339933;">        &lt;![CDATA[</span>
<span style="color: #339933;">            private function openSomeNodes():void {</span>
<span style="color: #339933;">                var xList:XMLList = dp..node.(hasOwnProperty(&quot;@isOpen&quot;) &amp;&amp; @isOpen == &quot;true&quot;);</span>
<span style="color: #339933;">                tree.openItems = xList;</span>
<span style="color: #339933;">            }</span>
&nbsp;
<span style="color: #339933;">            private function closeAllNodes():void {</span>
<span style="color: #339933;">                tree.openItems = [];</span>
<span style="color: #339933;">            }</span>
<span style="color: #339933;">        ]]&gt;</span>
<span style="color: #339933;">    &lt;/mx:Script&gt;</span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:XML</span> id=<span style="color: #ff0000;">&quot;dp&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;">&lt;root<span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;">&lt;node label=<span style="color: #ff0000;">&quot;Parent 1&quot;</span> isOpen=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;">&lt;node label=<span style="color: #ff0000;">&quot;Child 1&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;">&lt;node label=<span style="color: #ff0000;">&quot;Child 2&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;">&lt;node label=<span style="color: #ff0000;">&quot;Grandchild 1&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;node label=<span style="color: #ff0000;">&quot;Grandchild 2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;">&lt;/node<span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;">&lt;node label=<span style="color: #ff0000;">&quot;Child 3&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;">&lt;node label=<span style="color: #ff0000;">&quot;Child 4&quot;</span> isOpen=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;">&lt;node label=<span style="color: #ff0000;">&quot;Grandchild 3&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                        <span style="color: #000000;">&lt;node label=<span style="color: #ff0000;">&quot;Great-grandchild 1&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;node label=<span style="color: #ff0000;">&quot;Great-grandchild 2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;node label=<span style="color: #ff0000;">&quot;Great-grandchild 3&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;node label=<span style="color: #ff0000;">&quot;Great-grandchild 4&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                            <span style="color: #000000;">&lt;node label=<span style="color: #ff0000;">&quot;Great-great-grandchild 1&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;/node<span style="color: #7400FF;">&gt;</span></span>
                        <span style="color: #000000;">&lt;node label=<span style="color: #ff0000;">&quot;Grandchild 1&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;/node<span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;">&lt;node label=<span style="color: #ff0000;">&quot;Grandchild 4&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;">&lt;/node<span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;">&lt;node label=<span style="color: #ff0000;">&quot;Child 5&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;">&lt;/node<span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;">&lt;/root<span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:XML</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ApplicationControlBar</span> dock=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Button</span> label=<span style="color: #ff0000;">&quot;Open some nodes&quot;</span> click=<span style="color: #ff0000;">&quot;openSomeNodes();&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Button</span> label=<span style="color: #ff0000;">&quot;Close all nodes&quot;</span> click=<span style="color: #ff0000;">&quot;closeAllNodes();&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ApplicationControlBar</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Tree</span> id=<span style="color: #ff0000;">&quot;tree&quot;</span></span>
<span style="color: #000000;">            dataProvider=<span style="color: #ff0000;">&quot;{dp}&quot;</span></span>
<span style="color: #000000;">            showRoot=<span style="color: #ff0000;">&quot;false&quot;</span></span>
<span style="color: #000000;">            labelField=<span style="color: #ff0000;">&quot;@label&quot;</span></span>
<span style="color: #000000;">            width=<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;/mx:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Tree_openItems_test_3/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_openItems_test_3/bin/main.html" width="100%" height="300"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Expanding nodes in a Flex Tree control using the openItems property on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/01/15/expanding-nodes-in-a-flex-tree-control-using-the-openitems-property/',contentID: 'post-454',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'openItems',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/15/expanding-nodes-in-a-flex-tree-control-using-the-openitems-property/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Toggling item roll over highlighting in the Flex Tree control</title>
		<link>http://blog.flexexamples.com/2008/01/11/toggling-item-roll-over-highlighting-in-the-flex-tree-control/</link>
		<comments>http://blog.flexexamples.com/2008/01/11/toggling-item-roll-over-highlighting-in-the-flex-tree-control/#comments</comments>
		<pubDate>Fri, 11 Jan 2008 09:31:53 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Tree]]></category>
		<category><![CDATA[useRollOver]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/11/toggling-item-roll-over-highlighting-in-the-flex-tree-control/</guid>
		<description><![CDATA[<p>The following example shows how you can toggle item roll over highlighting in the Tree control in Flex by setting the useRollOver style.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Tree_useRollOver_test/main.mxml">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/01/11/toggling-item-roll-over-highlighting-in-the-flex-tree-control/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:XML id="treeDP"&#62; &#60;root&#62; &#60;node label="i) One" /&#62; &#60;node label="i) Two" /&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can toggle item roll over highlighting in the Tree control in Flex by setting the <code>useRollOver</code> style.</p>
<p>Full code after the jump.</p>
<p><span id="more-440"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Tree_useRollOver_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/11/toggling-item-roll-over-highlighting-in-the-flex-tree-control/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:XML id="treeDP"&gt;
        &lt;root&gt;
            &lt;node label="i) One" /&gt;
            &lt;node label="i) Two" /&gt;
            &lt;node label="i) Three" /&gt;
            &lt;node label="i) Four"&gt;
                &lt;node label="ii) One" /&gt;
                &lt;node label="ii) Two" /&gt;
                &lt;node label="ii) Three"&gt;
                    &lt;node label="iii) One" /&gt;
                    &lt;node label="iii) Two" /&gt;
                &lt;/node&gt;
                &lt;node label="ii) Four" /&gt;
            &lt;/node&gt;
            &lt;node label="i) Five" /&gt;
            &lt;node label="i) Six" /&gt;
        &lt;/root&gt;
    &lt;/mx:XML&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:CheckBox id="checkBox"
                label="useRollOver:"
                labelPlacement="left"
                selected="true" /&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:Tree id="tree"
            dataProvider="{treeDP}"
            labelField="@label"
            showRoot="false"
            useRollOver="{checkBox.selected}"
            width="200" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Tree_useRollOver_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_useRollOver_test/bin/main.html" width="100%" height="300"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Toggling item roll over highlighting in the Flex Tree control on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/01/11/toggling-item-roll-over-highlighting-in-the-flex-tree-control/',contentID: 'post-440',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'useRollOver',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/11/toggling-item-roll-over-highlighting-in-the-flex-tree-control/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

