Hi, all.
Please, look at the code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:creationComplete>
<![CDATA[
list.setFocus();
]]>
</mx:creationComplete>
<mx:HorizontalList id="list">
<mx:creationComplete>
<![CDATA[
setFocus();
]]>
</mx:creationComplete>
<mx:focusIn>
<![CDATA[
trace("Received focus");
]]>
</mx:focusIn>
<mx:keyDown>
<![CDATA[
trace("Key down");
]]>
</mx:keyDown>
<mx:dataProvider>
<mx:Object label="Some"/>
<mx:Object label="Different"/>
<mx:Object label="Stuff"/>
</mx:dataProvider>
</mx:HorizontalList>
As you see, I try to make my HorizontalList
focused when application is loaded. And I actually receive Received focus
message in console. But I expected that I would be able to navigate over list elements with arrow keys after setting focus. But that's not the case. They work only after clicking component with mouse. So, what am I doing wrong? How to make list have focus and respond to arrow keys?