A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: forms and the tab button

  1. #1
    Member
    Join Date
    Dec 2000
    Posts
    83
    Is there a way to be able to use the tab button on text fields in flash 5 when you create forms?

  2. #2
    Senior Member
    Join Date
    Apr 2001
    Posts
    433
    The only way I know of to do this is to "cheat" by placing a button off-stage, so no one sees it when you play the movie. in Frame 1 I have
    TOTALTEXTFIELDS = 5
    but you can change that depending on how many you have.
    I named my text fields TextField|0 through TextField|4.

    Note that it's important to use the | character before your number, but whatever is before it (the TextField part) can be changed to anything.

    On the button, put the actions
    on(keyPress"<TAB>") {
    current = Selection.getFocus()
    numStart = current.indexOf("|")
    trace(numStart)
    text = current.substring( 0, numStart )
    trace(text)
    number = current.substring(numStart+1, current.length)
    number = parseInt(number)
    trace(number)
    next = number + 1
    trace(next)
    if (next > TOTALTEXTFIELDS) {
    next = 0
    }
    Selection.setFocus(text + "|" + next)
    }

    Hope this helps
    Arctic

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