<?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; mouseEnabled</title>
	<atom:link href="http://blog.flexexamples.com/tag/mouseenabled/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>Preventing the user from clicking the track on a Spark HSlider control in Flex 4</title>
		<link>http://blog.flexexamples.com/2010/03/31/preventing-the-user-from-clicking-the-track-on-a-spark-hslider-control-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2010/03/31/preventing-the-user-from-clicking-the-track-on-a-spark-hslider-control-in-flex-4/#comments</comments>
		<pubDate>Wed, 31 Mar 2010 22:46:34 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Flex4]]></category>
		<category><![CDATA[HSlider (Spark)]]></category>
		<category><![CDATA[#track]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[mouseEnabled]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=2665</guid>
		<description><![CDATA[<p>The following example shows how you can toggle whether a user is allowed to click on a Spark HSlider control&#8217;s track in Flex 4 by setting the Boolean mouseEnabled property on the HSlider controls track skin part.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2010/03/31/preventing-the-user-from-clicking-the-track-on-a-spark-hslider-control-in-flex-4/ --&#62; &#60;s:Application name=&#34;Spark_HSlider_track_mouseEnabled_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/mx&#34;&#62; &#60;s:controlBarContent&#62; &#60;mx:Form&#62; &#60;mx:FormItem label=&#34;track.mouseEnabled:&#34;&#62; &#60;s:CheckBox id=&#34;chckBx&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can toggle whether a user is allowed to click on a Spark HSlider control&#8217;s track in Flex 4 by setting the Boolean <code>mouseEnabled</code> property on the HSlider controls <code>track</code> skin part.</p>
<p><span id="more-2665"></span></p>
<p class="alert">The following example(s) require Flash Player 10 and the Adobe Flex 4 SDK. To download the Adobe Flash Builder 4 trial, see <a href="http://bit.ly/crThlI">http://www.adobe.com/products/flex/</a>. To download the latest nightly build of the Flex 4 SDK, see <a href="http://bit.ly/Flex4SDK">http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4</a>.<br/><strong>For more information on getting started with Flex 4 and Flash Builder 4, see the official <a href="http://bit.ly/dCkecm">Adobe Flex Team blog</a>.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2010/03/31/preventing-the-user-from-clicking-the-track-on-a-spark-hslider-control-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;Spark_HSlider_track_mouseEnabled_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/mx&quot;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:controlBarContent</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Form</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:FormItem</span> label=<span style="color: #ff0000;">&quot;track.mouseEnabled:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:CheckBox</span> id=<span style="color: #ff0000;">&quot;chckBx&quot;</span> selected=<span style="color: #ff0000;">&quot;true&quot;</span> change=<span style="color: #ff0000;">&quot;chckBx_changeHandler(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Form</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:controlBarContent</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;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;">            protected function chckBx_changeHandler<span style="color: #66cc66;">&#40;</span>evt:Event<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                sl.track.mouseEnabled = chckBx.selected;</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:HSlider</span> id=<span style="color: #ff0000;">&quot;sl&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>
&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: 'Preventing the user from clicking the track on a Spark HSlider control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2010/03/31/preventing-the-user-from-clicking-the-track-on-a-spark-hslider-control-in-flex-4/',contentID: 'post-2665',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: '#track,Gumbo,mouseEnabled',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/2010/03/31/preventing-the-user-from-clicking-the-track-on-a-spark-hslider-control-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Disabling the mouse on the Spark VideoPlayer control scrub bar in Flex 4</title>
		<link>http://blog.flexexamples.com/2009/12/08/disabling-the-mouse-on-the-spark-videoplayer-control-scrub-bar-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2009/12/08/disabling-the-mouse-on-the-spark-videoplayer-control-scrub-bar-in-flex-4/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 15:03:01 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta2]]></category>
		<category><![CDATA[VideoPlayer (Spark)]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[mouseChildren]]></category>
		<category><![CDATA[mouseEnabled]]></category>
		<category><![CDATA[scrubBar]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=2238</guid>
		<description><![CDATA[<p>The following example shows how you can disable the mouse on the Spark VideoPlayer control scrub bar in Flex 4 by setting the Boolean mouseEnabled and mouseChildren properties.</p> <p>Full code after the jump.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2009/12/08/disabling-the-mouse-on-the-spark-videoplayer-control-scrub-bar-in-flex-4/ --&#62; &#60;s:Application name=&#34;Spark_VideoPlayer_scrubBar_mouseEnabled_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/mx&#34;&#62; &#60;s:controlBarContent&#62; &#60;s:CheckBox id=&#34;chBx&#34; label=&#34;mouseEnabled/mouseChildren&#34; selected=&#34;true&#34; change=&#34;chBx_changeHandler(event);&#34; /&#62; &#60;/s:controlBarContent&#62; &#160; &#60;fx:Script&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can disable the mouse on the Spark VideoPlayer control scrub bar in Flex 4 by setting the Boolean <code>mouseEnabled</code> and <code>mouseChildren</code> properties.</p>
<p>Full code after the jump.</p>
<p><span id="more-2238"></span></p>
<p class="alert">The following example(s) require Flash Player 10 and the Adobe Flex 4 SDK. To download the Adobe Flash Builder 4 trial, see <a href="http://bit.ly/crThlI">http://www.adobe.com/products/flex/</a>. To download the latest nightly build of the Flex 4 SDK, see <a href="http://bit.ly/Flex4SDK">http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4</a>.<br/><strong>For more information on getting started with Flex 4 and Flash Builder 4, see the official <a href="http://bit.ly/dCkecm">Adobe Flex Team blog</a>.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2009/12/08/disabling-the-mouse-on-the-spark-videoplayer-control-scrub-bar-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;Spark_VideoPlayer_scrubBar_mouseEnabled_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/mx&quot;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:controlBarContent</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:CheckBox</span> id=<span style="color: #ff0000;">&quot;chBx&quot;</span></span>
<span style="color: #000000;">                label=<span style="color: #ff0000;">&quot;mouseEnabled/mouseChildren&quot;</span></span>
<span style="color: #000000;">                selected=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #000000;">                change=<span style="color: #ff0000;">&quot;chBx_changeHandler(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:controlBarContent</span><span style="color: #7400FF;">&gt;</span></span>
&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;">            protected function chBx_changeHandler<span style="color: #66cc66;">&#40;</span>evt:Event<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                vdPlyr.scrubBar.mouseEnabled = chBx.selected;</span>
<span style="color: #000000;">                vdPlyr.scrubBar.mouseChildren = chBx.selected;</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:VideoPlayer</span> id=<span style="color: #ff0000;">&quot;vdPlyr&quot;</span></span>
<span style="color: #000000;">            source=<span style="color: #ff0000;">&quot;http://helpexamples.com/flash/video/caption_video.flv&quot;</span></span>
<span style="color: #000000;">            muted=<span style="color: #ff0000;">&quot;true&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>
&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: 'Disabling the mouse on the Spark VideoPlayer control scrub bar in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/12/08/disabling-the-mouse-on-the-spark-videoplayer-control-scrub-bar-in-flex-4/',contentID: 'post-2238',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'Gumbo,mouseChildren,mouseEnabled,scrubBar',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/12/08/disabling-the-mouse-on-the-spark-videoplayer-control-scrub-bar-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Preventing users from clicking on an Accordion container&#8217;s header in Flex</title>
		<link>http://blog.flexexamples.com/2008/05/30/preventing-users-from-clicking-on-an-accordion-containers-header-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/05/30/preventing-users-from-clicking-on-an-accordion-containers-header-in-flex/#comments</comments>
		<pubDate>Sat, 31 May 2008 06:19:48 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Accordion]]></category>
		<category><![CDATA[AccordionHeader]]></category>
		<category><![CDATA[headerRenderer]]></category>
		<category><![CDATA[mouseEnabled]]></category>
		<category><![CDATA[selectedIndex]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/05/30/preventing-users-from-clicking-on-an-accordion-containers-header-in-flex/</guid>
		<description><![CDATA[<p>The following examples show how you can prevent a user from clicking a Flex Accordion container&#8217;s header by creating a custom Accordion header renderer.</p> <p>Full code after the jump.</p> <p></p> <p>The following example uses a custom header renderer (MyAccHeader) which sets the header&#8217;s mouseEnabled property to false, preventing the user from changing the currently selected [...]]]></description>
			<content:encoded><![CDATA[<p>The following examples show how you can prevent a user from clicking a Flex Accordion container&#8217;s header by creating a custom Accordion header renderer.</p>
<p>Full code after the jump.</p>
<p><span id="more-651"></span></p>
<p>The following example uses a custom header renderer (MyAccHeader) which sets the header&#8217;s <code>mouseEnabled</code> property to <code>false</code>, preventing the user from changing the currently selected accordion child by clicking on the header. Instead, users are forced to change the active child by clicking the next and previous buttons.</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Accordion_headerRenderer_test_2/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/05/30/preventing-users-from-clicking-on-an-accordion-containers-header-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            private function prevChild():void {
                accordion.selectedIndex--;
            }

            private function nextChild():void {
                accordion.selectedIndex++;
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Accordion id="accordion"
            headerRenderer="comps.MyAccHeader"
            width="100%" height="100%"&gt;
        &lt;mx:VBox id="v1" label="One" width="100%" height="100%"&gt;
            &lt;mx:VBox width="100%" height="100%"&gt;
                &lt;mx:Label text="One" /&gt;
            &lt;/mx:VBox&gt;
            &lt;mx:ControlBar horizontalAlign="right" width="100%"&gt;
                &lt;mx:Spacer width="100%" /&gt;
                &lt;mx:Button label="next" click="nextChild();" /&gt;
            &lt;/mx:ControlBar&gt;
        &lt;/mx:VBox&gt;
        &lt;mx:VBox id="v2" label="Two" width="100%" height="100%"&gt;
            &lt;mx:VBox width="100%" height="100%"&gt;
                &lt;mx:Label text="Two" /&gt;
            &lt;/mx:VBox&gt;
            &lt;mx:ControlBar width="100%"&gt;
                &lt;mx:Button label="prev" click="prevChild();" /&gt;
                &lt;mx:Spacer width="100%" /&gt;
                &lt;mx:Button label="next" click="nextChild();" /&gt;
            &lt;/mx:ControlBar&gt;
        &lt;/mx:VBox&gt;
        &lt;mx:VBox id="v3" label="Three" width="100%" height="100%"&gt;
            &lt;mx:VBox width="100%" height="100%"&gt;
                &lt;mx:Label text="Three" /&gt;
            &lt;/mx:VBox&gt;
            &lt;mx:ControlBar width="100%"&gt;
                &lt;mx:Button label="prev" click="prevChild();" /&gt;
                &lt;mx:Spacer width="100%" /&gt;
                &lt;mx:Button label="next" click="nextChild();" /&gt;
            &lt;/mx:ControlBar&gt;
        &lt;/mx:VBox&gt;
        &lt;mx:VBox id="v4" label="Four" width="100%" height="100%"&gt;
            &lt;mx:VBox width="100%" height="100%"&gt;
                &lt;mx:Label text="Four" /&gt;
            &lt;/mx:VBox&gt;
            &lt;mx:ControlBar width="100%"&gt;
                &lt;mx:Button label="prev" click="prevChild();" /&gt;
                &lt;mx:Spacer width="100%" /&gt;
                &lt;mx:Button label="next" click="nextChild();" /&gt;
            &lt;/mx:ControlBar&gt;
        &lt;/mx:VBox&gt;
        &lt;mx:VBox id="v5" label="Five" width="100%" height="100%"&gt;
            &lt;mx:VBox width="100%" height="100%"&gt;
                &lt;mx:Label text="Five" /&gt;
            &lt;/mx:VBox&gt;
            &lt;mx:ControlBar width="100%"&gt;
                &lt;mx:Button label="prev" click="prevChild();" /&gt;
                &lt;mx:Spacer width="100%" /&gt;
            &lt;/mx:ControlBar&gt;
        &lt;/mx:VBox&gt;
    &lt;/mx:Accordion&gt;

&lt;/mx:Application&gt;
</pre>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Accordion_headerRenderer_test_2/bin/srcview/source/comps/MyAccHeader.as.html">comps/MyAccHeader.as</a></p>
<pre class="code">
/**
 * http://blog.flexexamples.com/2008/05/30/preventing-users-from-clicking-on-an-accordion-containers-header-in-flex/
 */
package comps {
    import mx.containers.accordionClasses.AccordionHeader;

    public class MyAccHeader extends AccordionHeader {
        public function MyAccHeader() {
            super();
            mouseEnabled = false;
        }
    }
}
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Accordion_headerRenderer_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/Accordion_headerRenderer_test_2/bin/main.html" width="100%" height="400"></iframe></p>
<p>The following example uses a custom header renderer (MyAccHeader) which sets the header&#8217;s <code>enabled</code> property to the value of the container&#8217;s <code>enabled</code> property, allowing you to selectively disable accordion headers.</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Accordion_headerRenderer_test_3/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/05/30/preventing-users-from-clicking-on-an-accordion-containers-header-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            private function prevChild():void {
                accordion.selectedIndex--;
            }

            private function nextChild():void {
                accordion.selectedIndex++;
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Accordion id="accordion"
            headerRenderer="comps.MyAccHeader"
            width="100%"
            height="100%"&gt;
        &lt;mx:VBox id="v1"
                label="One"
                width="100%"
                height="100%"&gt;
            &lt;mx:Label text="One" /&gt;
        &lt;/mx:VBox&gt;
        &lt;mx:VBox id="v2"
                label="Two"
                width="100%"
                height="100%"&gt;
            &lt;mx:Label text="Two" /&gt;
        &lt;/mx:VBox&gt;
        &lt;mx:VBox id="v3"
                label="Three"
                enabled="false"
                width="100%"
                height="100%"&gt;
            &lt;mx:Label text="Three" /&gt;
        &lt;/mx:VBox&gt;
        &lt;mx:VBox id="v4"
                label="Four"
                enabled="false"
                width="100%"
                height="100%"&gt;
            &lt;mx:Label text="Four" /&gt;
        &lt;/mx:VBox&gt;
        &lt;mx:VBox id="v5"
                label="Five"
                width="100%"
                height="100%"&gt;
               &lt;mx:Label text="Five" /&gt;
        &lt;/mx:VBox&gt;
    &lt;/mx:Accordion&gt;

&lt;/mx:Application&gt;
</pre>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Accordion_headerRenderer_test_3/bin/srcview/source/comps/MyAccHeader.as.html">comps/MyAccHeader.as</a></p>
<pre class="code">
/**
 * http://blog.flexexamples.com/2008/05/30/preventing-users-from-clicking-on-an-accordion-containers-header-in-flex/
 */
package comps {
    import mx.containers.accordionClasses.AccordionHeader;
    import mx.events.FlexEvent;

    public class MyAccHeader extends AccordionHeader {
        public function MyAccHeader() {
            super();
            addEventListener(FlexEvent.INITIALIZE, accordionHeader_initialize);
        }

        private function accordionHeader_initialize(evt:FlexEvent):void {
            enabled = data.enabled;
        }
    }
}
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Accordion_headerRenderer_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/Accordion_headerRenderer_test_3/bin/main.html" width="100%" height="400"></iframe></p>
<p class="new">You can also use ActionScript to toggle an accordion header&#8217;s <code>enabled</code> property using the following snippet:</p>
<pre class="code">
accordion.getHeaderAt(0).enabled = false;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Preventing users from clicking on an Accordion container\&#039;s header in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/05/30/preventing-users-from-clicking-on-an-accordion-containers-header-in-flex/',contentID: 'post-651',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'headerRenderer,mouseEnabled,selectedIndex',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/05/30/preventing-users-from-clicking-on-an-accordion-containers-header-in-flex/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

