dcsimg
A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: set focus and input text fields

  1. #1
    Senior Member
    Join Date
    Apr 2002
    Posts
    113

    set focus and input text fields

    I wrote a quiz that has 20 input text fields. Is there any way to set the order of focus when someone uses the tab button?

  2. #2
    more cowbell DigitalOne's Avatar
    Join Date
    Sep 2000
    Location
    Boston, MA
    Posts
    591
    I'd help you, but I don't know what you're talking about.

    Please clarify.

  3. #3
    Dignitary rynoe's Avatar
    Join Date
    Jan 2003
    Location
    Earth
    Posts
    761
    You sound like you do alot of VB. Microsoft loves to focus in on these kind of details. There is a way to do this in flash (mx anyway). Look at the setFocus method and get into that. I am not sure why this would be an issue on the internet. I don't think anyone expects pure keyboard with flash, especially with there are hundreds of mouse functions!

  4. #4
    Lord of the Singhs
    Join Date
    Mar 2002
    Location
    India
    Posts
    342
    one way i know is that u create the txtxfields in the same order as their tab index... this does do th trick for me.... i know its not a slick method but hey it works!!!
    CooL "N" CalM

    my body is sore
    my eyes are red
    i still itch for more
    before i hit the bed

  5. #5
    Dignitary rynoe's Avatar
    Join Date
    Jan 2003
    Location
    Earth
    Posts
    761
    Yep that is visual basic. NOT FLASH HOWEVER!

  6. #6
    Lord of the Singhs
    Join Date
    Mar 2002
    Location
    India
    Posts
    342
    i didnt know tht.... well... i'd better start lookin for a better method to do this... cos i dont like MS
    CooL "N" CalM

    my body is sore
    my eyes are red
    i still itch for more
    before i hit the bed

  7. #7
    Senior Member
    Join Date
    Apr 2002
    Posts
    113
    I've attached my file. This quiz is a Spanish vocabulary quiz. I would like students to be able to tab to the next question in order from 1 to 20. I appreciate everyone's ideas and help.
    Attached Files Attached Files

  8. #8
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Check TextField.tabIndex in the AS dictionary, under Help.

    myTextField1.tabIndex =1;
    myTextField2.tabIndex =2;
    mybutton1.tabIndex =3;
    myTextField3.tabIndex =4;
    Etc...

    The tab key will follow the above order. Use the instance names of the textfields and not their variables, which should have different names. If you set it initially with a difference of 5, e.g. 1, 5, 10, 15, etc... Then it will still tab in that order, but later you can insert other textfields and not have to change all the numbers of your textfields tab indexes.

  9. #9
    Senior Member
    Join Date
    Apr 2002
    Posts
    113
    You are an encyclopedia oldnewbie!!! Once again you've come through and helped me with my projects. My sincerest and deepest thanks.

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