# Navigation help

**URL:** <https://forum.kirupa.com/t/navigation-help/222902>\
**Category:** Uncategorized\
**Created:** [April 17, 2007, 8:31pm UTC](https://forum.kirupa.com/t/navigation-help/222902 "2007-04-17T20:31:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![onecommoncode](https://avatars.discourse-cdn.com/v4/letter/o/47e85d/32.png) [@onecommoncode](https://forum.kirupa.com/u/onecommoncode)\
**Post date:** [April 17, 2007, 8:31pm UTC](https://forum.kirupa.com/t/navigation-help/222902/1 "2007-04-17T20:31:40Z")

</div>

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.

```auto

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();

```
