A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: 2 way navigation with Flash Lite 2.1/AS2/N80

  1. #1
    Member
    Join Date
    Mar 2005
    Posts
    96

    2 way navigation with Flash Lite 2.1/AS2/N80

    Hi, im trying to create a navigation menu that is placed like the numbers, 1 3 5 7 9 if you look at your keyboard.. in illustration, it'll look like this



    i'd like it to work in N80, Action Script 2, Flash lite 2.1

    right now, N80 device and emulator controls it as a 4 way navigation, i'd like to use only either the Up and Down navigation or Left and Right to navigate this menu.. i've tried using tabIndex but it didn't work..

    Is it possible to achieve this or N80 won't simply support 2 way nav?
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    Apr 2001
    Location
    Akron OH, USA
    Posts
    4,841
    not quite sure I understand.

    Can you give a text description of what should happen if a user presses up/down or right/left?

    do you mean up/down only to control navigation instead of tabbing through interface with all keys (up/down/right/left)?

    how are you using ActionScript to "navigate"? Are you relying upon code in button events and Flash Lite's built-in tabbing to give focus to elements, or are you using non button movie clips and a key listener to give focus to elements?

  3. #3
    Member
    Join Date
    Mar 2005
    Posts
    96


    right now, for the user to maneuver around the buttons number 1-5, user would have to use the up, down, left, right navigation on the navigation pad. i'd like to make it where user would only have to use up and down OR left and right navigation to navigate through the buttons..

    for example, when user presses the left key, button 1 will be in focus, to get to button 3, user have to press the right button twice, as the buttons will have tabIndex sequence and can't skip.

    do you mean up/down only to control navigation instead of tabbing through interface with all keys (up/down/right/left)?
    Yes, you're right!

    how are you using ActionScript to "navigate"? Are you relying upon code in button events and Flash Lite's built-in tabbing to give focus to elements, or are you using non button movie clips and a key listener to give focus to elements?
    I'm using normal buttons in Flash Lite and using built-in tabbing to give focus to elements, and i tried to incorporate using tabIndex to give tab ordering to the buttons. for eg:

    one_btn.tabIndex = 1;
    two_btn.tabIndex = 2;
    three_btn.tabIndex = 3;
    four_btn.tabIndex = 4;

    so in this code, when user navigate button 1 will get focus first, followed by button 2, button 3 and button 4. regardless whatever navigation direction they click. but this didn't work as what i included in my previous post, a .fla that uses this technique but didn't work

  4. #4
    Registered User
    Join Date
    Apr 2001
    Location
    Akron OH, USA
    Posts
    4,841
    I think Flash is expecting a tab key press from the tabIndex, though devices do not normally support the tab key, which may be why it does not work.

    I am not sure if there is a built-in ActionScript property that you can set to control the order in which a device gives focus to button objects on a device.

    An alternative is to capture events using key listener and use ActionScript to change the focus of the user interface elements. You essentially build your own system to show which element has focus based upon key presses.

    For example, instead of having several different buttons on screen, each element would be a movie clip that becomes highlighted (change to a frame or change a color object) depending upon the number of presses from your navigation keys. Each ui mc element can contain a button incase you need to support touch screen devices or those supporting a mouse, but buttons are not necessary for phone keypad interfaces.

    For phone ui the only time you really need a button is for a Flash Lite 1.1 off screen keycatcher, which serves a similar purpose as the key object and key listener in Flash Lite 2.x.

    So perhaps a simple example is for each right key press you increase a counter and use an if/then or switch statement to execute ActionScript that gives focus (ie highlight) the appropriate movie clip and remove focus (remove highlight) from the previously select movie clip. When you reach the last element, reset the counter. You may also build in a wrap around behavior to go back to the first element if the user presses the right key again when the last element has focus, and reverse wraparound for left key press when first element has focus.

    With this approach you have total control over the ui behavior, though you have to code more than just setting tab index.

  5. #5
    Member
    Join Date
    Mar 2005
    Posts
    96
    Ah, i think that's a wonderful idea. I'll try to work on that and see if i can make it work! thanks for the gr8 idea!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center