I built a vertical xml navigation which I have added a rollover, rollout and release effect. The release effect is setup so that when you click on a nav item it will become highlighted, and if you click on a new button the old button will become un-highlighted and the new button will become highlighted.
I now would like to add a key listener so that if you click on a nav item lets say 3. You can use the up and down arrow to highlight and move up and down the navigation.
I built my function that traces up and down when you hit the correct arrow. I am just having problems with how to connect it to my navigation. Any help would be appreciated.
function initKeyNav():Void
{
var keyListener:Object = new Object();
keyListener.onKeyDown = function():Void
{
if(Key.isDown(37) || Key.isDown(38))
{
trace("up");
}
else if(Key.isDown(39) || Key.isDown(40))
{
trace("down");
}
}
Key.addListener(keyListener);
}
initKeyNav();