A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Using tab key?

  1. #1

    Using tab key?

    I'm wondering if it's possible when using a FLASH mail form, loaded into a container clip, to:

    First, have the movie open with the first text field highlighted - so that when the user selects the form, and after it opens, they can begin typing without having to use the mouse to highlight that text field.

    And

    Second, I would like to be able to tab from one text field to the next in the order the fields appear in the form.

    Currently, when I test the tab key moves the cursor to each element
    (I think MC) loaded into the _root timeline regardless of its level
    and location or order.

    (Using V5)

    Any thoughts?

  2. #2
    Anyone?

  3. #3
    Junior Member scudsucker's Avatar
    Join Date
    Feb 2003
    Location
    Cape Town, RSA
    Posts
    1,509
    Anything is possible! OK, with MX, anyway..

    OK, myTextField.setFocus will do the first question , and myTextField.setTabIndex will do the second.

    Use myTextField.tabEnabled=false for fields that describe the input textboxes so they dont tab. And theres even some code to prevent that ugly yellow box around highlighted items,

    myTextField._focusrect = false;

    or
    _global._focusrect=false;

    edit..(oops, didnt read that little 'using V5' at the bottom) I dont know if these methods work with F5, I doubt it. Sorry!)
    Last edited by scudsucker; 09-17-2003 at 04:12 AM.
    Hariyemadzisawira nhaka yedu! Down the SCUD and win!
    I'm too lazy to read Private Messages.

  4. #4
    Junior Member scudsucker's Avatar
    Join Date
    Feb 2003
    Location
    Cape Town, RSA
    Posts
    1,509
    Oh.. I was surfing were-here.com, and found this untested code, place on a blank button that does nothing else:
    Code:
    on (keyPress "<TAB>") {
    	if (selection.getFocus == "firstName") {
    		selection.setFocus = "lastName";
    	} else if (selection.getFocus == "lastName") {
    		selection.setFocus = "address";
    	}
    }//and so on down the line...
    the URL is here
    Hariyemadzisawira nhaka yedu! Down the SCUD and win!
    I'm too lazy to read Private Messages.

  5. #5
    COOL...very cool!

    I appriciate your leg work! I'll give it a go and see if it
    works, then let ya know.

    Concept sounds easy enough!

    Thanks!

  6. #6
    OK...after a bit of work...I've discovered that the concept above is right, though the script is formatted incorrectly. Also, with this type of action it's necessary to spell out the exact path to your text fields from _level0 (using '_root' or 'this' will cause the action to NOT exicute)

    Code:
    on (keyPress "<Tab>") {
    	if (Selection.getFocus() == "_level0.ContainerMC3.Form.CompanyName") {
    		Selection.setFocus("_level0.ContainerMC3.Form.CompanyContact");
    	} else if (Selection.getFocus() == "_level0.ContainerMC3.Form.CompanyContact") {
    		Selection.setFocus("_level0.ContainerMC3.Form.CompanyPhone");
    	} else if (Selection.getFocus() == "_level0.ContainerMC3.Form.CompanyPhone") {
    		Selection.setFocus("_level0.ContainerMC3.Form.CompanyEmail");
    	}
    }
    //and so on...//
    Thanks for the clues, I would have never got this without your assistence.

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