<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Disabling keyboard navigation on the Accordion container in Flex</title>
	<atom:link href="http://blog.flexexamples.com/2008/06/10/disabling-keyboard-navigation-on-the-accordion-container-in-flex/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com/2008/06/10/disabling-keyboard-navigation-on-the-accordion-container-in-flex/</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Sun, 12 Feb 2012 19:26:49 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: dev</title>
		<link>http://blog.flexexamples.com/2008/06/10/disabling-keyboard-navigation-on-the-accordion-container-in-flex/comment-page-1/#comment-4983</link>
		<dc:creator>dev</dc:creator>
		<pubDate>Thu, 06 Aug 2009 15:39:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/06/10/disabling-keyboard-navigation-on-the-accordion-container-in-flex/#comment-4983</guid>
		<description>Thank a lot. I am creating all sorts of &quot;key less&quot; stuff now
&lt;pre lang=&quot;actionscript3&quot;&gt;
package com.quiz.multichoice.comp
{
    import mx.controls.LinkButton;
    import flash.events.KeyboardEvent;
    public class NoKeyLinkButton extends LinkButton
    {
        public function NoKeyLinkButton()
        {
            super();
        }
        override protected function keyDownHandler(evt:KeyboardEvent):void {
        }	
    }
}
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Thank a lot. I am creating all sorts of &#8220;key less&#8221; stuff now</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span> com<span style="color: #000066; font-weight: bold;">.</span>quiz<span style="color: #000066; font-weight: bold;">.</span>multichoice<span style="color: #000066; font-weight: bold;">.</span>comp
<span style="color: #000000;">&#123;</span>
    <span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>controls<span style="color: #000066; font-weight: bold;">.</span>LinkButton<span style="color: #000066; font-weight: bold;">;</span>
    <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">KeyboardEvent</span><span style="color: #000066; font-weight: bold;">;</span>
    <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> NoKeyLinkButton <span style="color: #0033ff; font-weight: bold;">extends</span> LinkButton
    <span style="color: #000000;">&#123;</span>
        <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> NoKeyLinkButton<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            <span style="color: #0033ff; font-weight: bold;">super</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
        <span style="color: #000000;">&#125;</span>
        override <span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #339966; font-weight: bold;">function</span> keyDownHandler<span style="color: #000000;">&#40;</span>evt<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">KeyboardEvent</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
        <span style="color: #000000;">&#125;</span>	
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: yon</title>
		<link>http://blog.flexexamples.com/2008/06/10/disabling-keyboard-navigation-on-the-accordion-container-in-flex/comment-page-1/#comment-3362</link>
		<dc:creator>yon</dc:creator>
		<pubDate>Mon, 01 Dec 2008 19:54:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/06/10/disabling-keyboard-navigation-on-the-accordion-container-in-flex/#comment-3362</guid>
		<description>I created a blog, i plan to post articles about flex and coding as soon as i have some free time
By now i have the code i posted above (without errors, since i didnt parsed it to be digested by the postin machine in here..) with a working example.
You can read it here
http://faithoncode.wordpress.com/2008/11/11/flex-accordionheaders/

Regards</description>
		<content:encoded><![CDATA[<p>I created a blog, i plan to post articles about flex and coding as soon as i have some free time<br />
By now i have the code i posted above (without errors, since i didnt parsed it to be digested by the postin machine in here..) with a working example.<br />
You can read it here<br />
<a href="http://faithoncode.wordpress.com/2008/11/11/flex-accordionheaders/" rel="nofollow">http://faithoncode.wordpress.com/2008/11/11/flex-accordionheaders/</a></p>
<p>Regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: thomary</title>
		<link>http://blog.flexexamples.com/2008/06/10/disabling-keyboard-navigation-on-the-accordion-container-in-flex/comment-page-1/#comment-3363</link>
		<dc:creator>thomary</dc:creator>
		<pubDate>Fri, 07 Nov 2008 17:56:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/06/10/disabling-keyboard-navigation-on-the-accordion-container-in-flex/#comment-3363</guid>
		<description>I used a work around.   added a blank page and defaulted to that one.

Thanks for all these pages.
I found a lot of useful pages here.</description>
		<content:encoded><![CDATA[<p>I used a work around.   added a blank page and defaulted to that one.</p>
<p>Thanks for all these pages.<br />
I found a lot of useful pages here.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: thomary</title>
		<link>http://blog.flexexamples.com/2008/06/10/disabling-keyboard-navigation-on-the-accordion-container-in-flex/comment-page-1/#comment-3364</link>
		<dc:creator>thomary</dc:creator>
		<pubDate>Fri, 07 Nov 2008 16:03:52 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/06/10/disabling-keyboard-navigation-on-the-accordion-container-in-flex/#comment-3364</guid>
		<description>I was looking for code to open myform with the accordion totally collapsed.  In other words, all accordion pages are not open.  The default is to have the first page opened.

I looked through Adobe forums, adobe class for accordion and around the internet.
I think I need something like:
 my_acc.getChildAt(my_acc.numChildren -1);

I tried:

cfformitem type=&quot;script&quot;
function formOnLoad(){
var theChild_obj:Object = {};
var theChild_obj:Object = info.getChildAt(info.numChildren -1);
}
/cfformitem
But this did not work.
I am using CFusion MX 7 with cfform format=&quot;Flash&quot;
Any help would be greatly appreciated.
Thanks, Thomary</description>
		<content:encoded><![CDATA[<p>I was looking for code to open myform with the accordion totally collapsed.  In other words, all accordion pages are not open.  The default is to have the first page opened.</p>
<p>I looked through Adobe forums, adobe class for accordion and around the internet.<br />
I think I need something like:<br />
 my_acc.getChildAt(my_acc.numChildren -1);</p>
<p>I tried:</p>
<p>cfformitem type=&#8221;script&#8221;<br />
function formOnLoad(){<br />
var theChild_obj:Object = {};<br />
var theChild_obj:Object = info.getChildAt(info.numChildren -1);<br />
}<br />
/cfformitem<br />
But this did not work.<br />
I am using CFusion MX 7 with cfform format=&#8221;Flash&#8221;<br />
Any help would be greatly appreciated.<br />
Thanks, Thomary</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yon</title>
		<link>http://blog.flexexamples.com/2008/06/10/disabling-keyboard-navigation-on-the-accordion-container-in-flex/comment-page-1/#comment-3365</link>
		<dc:creator>Yon</dc:creator>
		<pubDate>Wed, 08 Oct 2008 21:17:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/06/10/disabling-keyboard-navigation-on-the-accordion-container-in-flex/#comment-3365</guid>
		<description>I made an accordion some time ago on kind of this line, I extended the accordion, however i didnt wanted to disable keyboard, just wanted to disable navigation to disabled headers, but still be able to use both mouse and keyboard to navigate.

I use a recursive function to achieve this, however it acts funny if u disable all headers (but why disable all headers anyways..)
&lt;pre lang=&quot;actionscript3&quot;&gt;
package renders {
	import mx.events.IndexChangedEvent;
	import flash.events.KeyboardEvent;
	import mx.containers.Accordion;
	import mx.core.mx_internal;
	import flash.events.Event;
	import flash.ui.Keyboard;


	public class PracticalAccordion extends Accordion {
		private var _focusedIndex:int = -1;

		public function PracticalAccordion() {
			super();
		}

	    private function drawHeaderFocus(headerIndex:int, isFocused:Boolean):void {
	        if (headerIndex != -1)
	            getHeaderAt(headerIndex).drawFocus(isFocused);
	    }

        override protected function keyDownHandler(event:KeyboardEvent):void {
	        if (event.target != this)
	            return;

	        var prevValue:int = selectedIndex;
	        if(event.keyCode != Keyboard.SPACE &amp;&amp; event.keyCode != Keyboard.ENTER)
	        	drawHeaderFocus(_focusedIndex, false);
	        getIndexPlus(event, 0, prevValue);
	        if(event.keyCode != Keyboard.SPACE &amp;&amp; event.keyCode != Keyboard.ENTER)
                drawHeaderFocus(_focusedIndex, true);
            event.stopPropagation();
            if(event.keyCode != Keyboard.DOWN &amp;&amp; event.keyCode != Keyboard.UP &amp;&amp; event.keyCode != Keyboard.LEFT &amp;&amp; event.keyCode != Keyboard.RIGHT)
            	dispatchChangeEvent(prevValue, selectedIndex, event);
        }

        private function getIndexPlus (event:KeyboardEvent, loop:int, prevValue:int):void {
	        switch (event.keyCode) {
	            case Keyboard.PAGE_DOWN: {
	                _focusedIndex = selectedIndex = (selectedIndex  0 ? selectedIndex - 1 : numChildren - 1);
	                break;
	            }
	            case Keyboard.HOME: {
	                _focusedIndex = selectedIndex = 0;
	                break;
	            }
	            case Keyboard.END: {
	                _focusedIndex = selectedIndex = numChildren - 1;
	                break;
	            }
	            case Keyboard.DOWN:
	            case Keyboard.RIGHT: {
	                _focusedIndex = (_focusedIndex  0 ? _focusedIndex - 1 : numChildren - 1);
	                break;
	            }
	            case Keyboard.SPACE:
	            case Keyboard.ENTER: {
	                if (_focusedIndex != selectedIndex) {
	                    selectedIndex = _focusedIndex;
	                }
	                break;
	            }
	        }

          if (_focusedIndex != selectedIndex) {
            	if(!getHeaderAt(selectedIndex).enabled &#124;&#124; !getHeaderAt(_focusedIndex).enabled)
            		if(loop &lt;= numChildren)
            			getIndexPlus(event, loop + 1, prevValue);
/*             		else {
            			_focusedIndex = prevValue;
            			set selectedIndex(prevValue);
            		} */
           	} else
	           	if(!getHeaderAt(selectedIndex).enabled)
	           		if(loop &lt;= numChildren)
	            		getIndexPlus(event, loop + 1, prevValue);
/* 					else {
            			_focusedIndex = prevValue;
            			set selectedIndex(prevValue)
     				} */
        }

	    private function dispatchChangeEvent(oldIndex:int,
	                                         newIndex:int,
	                                         cause:Event = null):void {
	        var indexChangeEvent:IndexChangedEvent =
	            new IndexChangedEvent(IndexChangedEvent.CHANGE);
	        indexChangeEvent.oldIndex = oldIndex;
	        indexChangeEvent.newIndex = newIndex;
	        indexChangeEvent.relatedObject = getChildAt(newIndex);
	        indexChangeEvent.triggerEvent = cause;
	        dispatchEvent(indexChangeEvent);
	    }
	}
}
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>I made an accordion some time ago on kind of this line, I extended the accordion, however i didnt wanted to disable keyboard, just wanted to disable navigation to disabled headers, but still be able to use both mouse and keyboard to navigate.</p>
<p>I use a recursive function to achieve this, however it acts funny if u disable all headers (but why disable all headers anyways..)</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span> renders <span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>events<span style="color: #000066; font-weight: bold;">.</span>IndexChangedEvent<span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">KeyboardEvent</span><span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>containers<span style="color: #000066; font-weight: bold;">.</span>Accordion<span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>core<span style="color: #000066; font-weight: bold;">.</span>mx_internal<span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">Event</span><span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.ui</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">Keyboard</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> PracticalAccordion <span style="color: #0033ff; font-weight: bold;">extends</span> Accordion <span style="color: #000000;">&#123;</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _focusedIndex<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">int</span> = <span style="color: #000066; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> PracticalAccordion<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">super</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
		<span style="color: #000000;">&#125;</span>
&nbsp;
	    <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> drawHeaderFocus<span style="color: #000000;">&#40;</span>headerIndex<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">int</span><span style="color: #000066; font-weight: bold;">,</span> isFocused<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
	        <span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>headerIndex <span style="color: #000066; font-weight: bold;">!</span>= <span style="color: #000066; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span>
	            getHeaderAt<span style="color: #000000;">&#40;</span>headerIndex<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">.</span>drawFocus<span style="color: #000000;">&#40;</span>isFocused<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
	    <span style="color: #000000;">&#125;</span>
&nbsp;
        override <span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #339966; font-weight: bold;">function</span> keyDownHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">KeyboardEvent</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
	        <span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">target</span> <span style="color: #000066; font-weight: bold;">!</span>= <span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000000;">&#41;</span>
	            <span style="color: #0033ff; font-weight: bold;">return</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
	        <span style="color: #6699cc; font-weight: bold;">var</span> prevValue<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">int</span> = selectedIndex<span style="color: #000066; font-weight: bold;">;</span>
	        <span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">keyCode</span> <span style="color: #000066; font-weight: bold;">!</span>= <span style="color: #004993;">Keyboard</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">SPACE</span> <span style="color: #000066; font-weight: bold;">&amp;</span>amp<span style="color: #000066; font-weight: bold;">;&amp;</span>amp<span style="color: #000066; font-weight: bold;">;</span> event<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">keyCode</span> <span style="color: #000066; font-weight: bold;">!</span>= <span style="color: #004993;">Keyboard</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">ENTER</span><span style="color: #000000;">&#41;</span>
	        	drawHeaderFocus<span style="color: #000000;">&#40;</span>_focusedIndex<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
	        getIndexPlus<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> prevValue<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
	        <span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">keyCode</span> <span style="color: #000066; font-weight: bold;">!</span>= <span style="color: #004993;">Keyboard</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">SPACE</span> <span style="color: #000066; font-weight: bold;">&amp;</span>amp<span style="color: #000066; font-weight: bold;">;&amp;</span>amp<span style="color: #000066; font-weight: bold;">;</span> event<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">keyCode</span> <span style="color: #000066; font-weight: bold;">!</span>= <span style="color: #004993;">Keyboard</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">ENTER</span><span style="color: #000000;">&#41;</span>
                drawHeaderFocus<span style="color: #000000;">&#40;</span>_focusedIndex<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
            event<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">stopPropagation</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
            <span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">keyCode</span> <span style="color: #000066; font-weight: bold;">!</span>= <span style="color: #004993;">Keyboard</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">DOWN</span> <span style="color: #000066; font-weight: bold;">&amp;</span>amp<span style="color: #000066; font-weight: bold;">;&amp;</span>amp<span style="color: #000066; font-weight: bold;">;</span> event<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">keyCode</span> <span style="color: #000066; font-weight: bold;">!</span>= <span style="color: #004993;">Keyboard</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">UP</span> <span style="color: #000066; font-weight: bold;">&amp;</span>amp<span style="color: #000066; font-weight: bold;">;&amp;</span>amp<span style="color: #000066; font-weight: bold;">;</span> event<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">keyCode</span> <span style="color: #000066; font-weight: bold;">!</span>= <span style="color: #004993;">Keyboard</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">LEFT</span> <span style="color: #000066; font-weight: bold;">&amp;</span>amp<span style="color: #000066; font-weight: bold;">;&amp;</span>amp<span style="color: #000066; font-weight: bold;">;</span> event<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">keyCode</span> <span style="color: #000066; font-weight: bold;">!</span>= <span style="color: #004993;">Keyboard</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">RIGHT</span><span style="color: #000000;">&#41;</span>
            	dispatchChangeEvent<span style="color: #000000;">&#40;</span>prevValue<span style="color: #000066; font-weight: bold;">,</span> selectedIndex<span style="color: #000066; font-weight: bold;">,</span> event<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> getIndexPlus <span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">KeyboardEvent</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">loop</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">int</span><span style="color: #000066; font-weight: bold;">,</span> prevValue<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">int</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
	        <span style="color: #0033ff; font-weight: bold;">switch</span> <span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">keyCode</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
	            <span style="color: #0033ff; font-weight: bold;">case</span> <span style="color: #004993;">Keyboard</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">PAGE_DOWN</span><span style="color: #000066; font-weight: bold;">:</span> <span style="color: #000000;">&#123;</span>
	                _focusedIndex = selectedIndex = <span style="color: #000000;">&#40;</span>selectedIndex  <span style="color: #000000; font-weight:bold;">0</span> <span style="color: #000066; font-weight: bold;">?</span> selectedIndex <span style="color: #000066; font-weight: bold;">-</span> <span style="color: #000000; font-weight:bold;">1</span> <span style="color: #000066; font-weight: bold;">:</span> <span style="color: #004993;">numChildren</span> <span style="color: #000066; font-weight: bold;">-</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
	                <span style="color: #0033ff; font-weight: bold;">break</span><span style="color: #000066; font-weight: bold;">;</span>
	            <span style="color: #000000;">&#125;</span>
	            <span style="color: #0033ff; font-weight: bold;">case</span> <span style="color: #004993;">Keyboard</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">HOME</span><span style="color: #000066; font-weight: bold;">:</span> <span style="color: #000000;">&#123;</span>
	                _focusedIndex = selectedIndex = <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">;</span>
	                <span style="color: #0033ff; font-weight: bold;">break</span><span style="color: #000066; font-weight: bold;">;</span>
	            <span style="color: #000000;">&#125;</span>
	            <span style="color: #0033ff; font-weight: bold;">case</span> <span style="color: #004993;">Keyboard</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">END</span><span style="color: #000066; font-weight: bold;">:</span> <span style="color: #000000;">&#123;</span>
	                _focusedIndex = selectedIndex = <span style="color: #004993;">numChildren</span> <span style="color: #000066; font-weight: bold;">-</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">;</span>
	                <span style="color: #0033ff; font-weight: bold;">break</span><span style="color: #000066; font-weight: bold;">;</span>
	            <span style="color: #000000;">&#125;</span>
	            <span style="color: #0033ff; font-weight: bold;">case</span> <span style="color: #004993;">Keyboard</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">DOWN</span><span style="color: #000066; font-weight: bold;">:</span>
	            <span style="color: #0033ff; font-weight: bold;">case</span> <span style="color: #004993;">Keyboard</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">RIGHT</span><span style="color: #000066; font-weight: bold;">:</span> <span style="color: #000000;">&#123;</span>
	                _focusedIndex = <span style="color: #000000;">&#40;</span>_focusedIndex  <span style="color: #000000; font-weight:bold;">0</span> <span style="color: #000066; font-weight: bold;">?</span> _focusedIndex <span style="color: #000066; font-weight: bold;">-</span> <span style="color: #000000; font-weight:bold;">1</span> <span style="color: #000066; font-weight: bold;">:</span> <span style="color: #004993;">numChildren</span> <span style="color: #000066; font-weight: bold;">-</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
	                <span style="color: #0033ff; font-weight: bold;">break</span><span style="color: #000066; font-weight: bold;">;</span>
	            <span style="color: #000000;">&#125;</span>
	            <span style="color: #0033ff; font-weight: bold;">case</span> <span style="color: #004993;">Keyboard</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">SPACE</span><span style="color: #000066; font-weight: bold;">:</span>
	            <span style="color: #0033ff; font-weight: bold;">case</span> <span style="color: #004993;">Keyboard</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">ENTER</span><span style="color: #000066; font-weight: bold;">:</span> <span style="color: #000000;">&#123;</span>
	                <span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>_focusedIndex <span style="color: #000066; font-weight: bold;">!</span>= selectedIndex<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
	                    selectedIndex = _focusedIndex<span style="color: #000066; font-weight: bold;">;</span>
	                <span style="color: #000000;">&#125;</span>
	                <span style="color: #0033ff; font-weight: bold;">break</span><span style="color: #000066; font-weight: bold;">;</span>
	            <span style="color: #000000;">&#125;</span>
	        <span style="color: #000000;">&#125;</span>
&nbsp;
          <span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>_focusedIndex <span style="color: #000066; font-weight: bold;">!</span>= selectedIndex<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
            	<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span><span style="color: #000066; font-weight: bold;">!</span>getHeaderAt<span style="color: #000000;">&#40;</span>selectedIndex<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">enabled</span> <span style="color: #000066; font-weight: bold;">||</span> <span style="color: #000066; font-weight: bold;">!</span>getHeaderAt<span style="color: #000000;">&#40;</span>_focusedIndex<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">enabled</span><span style="color: #000000;">&#41;</span>
            		<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">loop</span> <span style="color: #000066; font-weight: bold;">&amp;</span>lt<span style="color: #000066; font-weight: bold;">;</span>= <span style="color: #004993;">numChildren</span><span style="color: #000000;">&#41;</span>
            			getIndexPlus<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">loop</span> <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">,</span> prevValue<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #3f5fbf;">/*             		else {
            			_focusedIndex = prevValue;
            			set selectedIndex(prevValue);
            		} */</span>
           	<span style="color: #000000;">&#125;</span> <span style="color: #0033ff; font-weight: bold;">else</span>
	           	<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span><span style="color: #000066; font-weight: bold;">!</span>getHeaderAt<span style="color: #000000;">&#40;</span>selectedIndex<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">enabled</span><span style="color: #000000;">&#41;</span>
	           		<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">loop</span> <span style="color: #000066; font-weight: bold;">&amp;</span>lt<span style="color: #000066; font-weight: bold;">;</span>= <span style="color: #004993;">numChildren</span><span style="color: #000000;">&#41;</span>
	            		getIndexPlus<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">loop</span> <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">,</span> prevValue<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #3f5fbf;">/* 					else {
            			_focusedIndex = prevValue;
            			set selectedIndex(prevValue)
     				} */</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
	    <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> dispatchChangeEvent<span style="color: #000000;">&#40;</span>oldIndex<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">int</span><span style="color: #000066; font-weight: bold;">,</span>
	                                         newIndex<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">int</span><span style="color: #000066; font-weight: bold;">,</span>
	                                         cause<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Event</span> = <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
	        <span style="color: #6699cc; font-weight: bold;">var</span> indexChangeEvent<span style="color: #000066; font-weight: bold;">:</span>IndexChangedEvent =
	            <span style="color: #0033ff; font-weight: bold;">new</span> IndexChangedEvent<span style="color: #000000;">&#40;</span>IndexChangedEvent<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">CHANGE</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
	        indexChangeEvent<span style="color: #000066; font-weight: bold;">.</span>oldIndex = oldIndex<span style="color: #000066; font-weight: bold;">;</span>
	        indexChangeEvent<span style="color: #000066; font-weight: bold;">.</span>newIndex = newIndex<span style="color: #000066; font-weight: bold;">;</span>
	        indexChangeEvent<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">relatedObject</span> = <span style="color: #004993;">getChildAt</span><span style="color: #000000;">&#40;</span>newIndex<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
	        indexChangeEvent<span style="color: #000066; font-weight: bold;">.</span>triggerEvent = cause<span style="color: #000066; font-weight: bold;">;</span>
	        <span style="color: #004993;">dispatchEvent</span><span style="color: #000000;">&#40;</span>indexChangeEvent<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
	    <span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: Nick</title>
		<link>http://blog.flexexamples.com/2008/06/10/disabling-keyboard-navigation-on-the-accordion-container-in-flex/comment-page-1/#comment-3361</link>
		<dc:creator>Nick</dc:creator>
		<pubDate>Mon, 16 Jun 2008 21:01:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/06/10/disabling-keyboard-navigation-on-the-accordion-container-in-flex/#comment-3361</guid>
		<description>Hey Peter,

Just wanted to say thank you again! This worked out perfectly for what I needed it for.

Thanks,

- Nick</description>
		<content:encoded><![CDATA[<p>Hey Peter,</p>
<p>Just wanted to say thank you again! This worked out perfectly for what I needed it for.</p>
<p>Thanks,</p>
<p>- Nick</p>
]]></content:encoded>
	</item>
</channel>
</rss>

