A Flash Developer Resource Site

Results 1 to 13 of 13

Thread: tab control problems...

  1. #1
    Member
    Join Date
    Feb 2005
    Location
    manchester, england
    Posts
    98

    tab control problems...

    i'm using some actionscript to allow the tab button to move the cursor from one form entry to the next... i've used this script for a few different sites without a problem, however, in one of my movies it just doesn't want to work! uuuurrrggghhh???!!

    i cannot figure out why this is... i've tried changing different parts of the script and variable names, and tried putting the entire form in the movie as a MC... but nothing.

    i've attached the file; if someone could please help!

    cheers

  2. #2
    Senior Member chi-styler's Avatar
    Join Date
    Jul 2001
    Location
    Bristol, UK
    Posts
    1,237
    Can't see a file here

  3. #3
    Member
    Join Date
    Feb 2005
    Location
    manchester, england
    Posts
    98
    ...sorry!
    Attached Files Attached Files

  4. #4
    Senior Member chi-styler's Avatar
    Join Date
    Jul 2001
    Location
    Bristol, UK
    Posts
    1,237
    I think you're overcomplicating things there. Just name your boxes: wm_name_box, wm_pass_box, pr_name_box, pr_pass_box and put this code on the root,

    wm_name_box.tabIndex = 1;
    wm_pass_box.tabIndex = 2;
    pr_name_box.tabIndex = 3;
    pr_pass_box.tabIndex = 4;

  5. #5
    Member
    Join Date
    Feb 2005
    Location
    manchester, england
    Posts
    98
    thanks... that works ok, but...

    are the numbers meant to specify the order in which the input boxes are selected? (which is ideally what i'm after, although not necessarily on this form as it's so simple).

    is there anyway to stop the login button being selected if the tab button is hit after the last input box?

    the other script allowed control of which input is selected next (when it worked!)

    and is there any script to allow the specific login button (on the relevant form) to be selected on pressing the enter key?

  6. #6
    Senior Member chi-styler's Avatar
    Join Date
    Jul 2001
    Location
    Bristol, UK
    Posts
    1,237
    Yes, the numbers specify the order of the tabbing.

    To stop the login button being selected go

    my_login_button.tabEnabled = false;


    and to determine which form the user is in when the enter key is pressed just use

    cur_field = Selection.getFocus();

  7. #7
    Junior Member
    Join Date
    Feb 2005
    Posts
    13
    just wondered where the actionscript

    cur_field = Selection.getFocus();

    would need to be placed in this example??

  8. #8
    Senior Member chi-styler's Avatar
    Join Date
    Jul 2001
    Location
    Bristol, UK
    Posts
    1,237
    You could put it on the keyPress for the button, or do it yourself with this code
    code:

    kList = new Object();
    kList.onKeyUp = function () {
    if(Key.getCode() == 13) {
    if(Selection.getFocus() == "_level0.wm_name_box" || Selection.getFocus() == "_level0.wm_pass_box") {
    doWebMailStuff();
    }
    }
    }
    Key.addListener(kList);

    Last edited by chi-styler; 02-11-2005 at 12:19 PM.

  9. #9
    Member
    Join Date
    Feb 2005
    Location
    manchester, england
    Posts
    98
    thanks for your help chi

    i'm going to take a look at it this weekend... but i still don't know why my original script (on the attached file), which works for most of my other sites, doesn't work in this case...?

  10. #10
    Member
    Join Date
    Feb 2005
    Location
    manchester, england
    Posts
    98
    i can't figure out the new script provided, thanks anyway...
    could somebody please help me with the script i'm already using (as attached), as i'm sure there is just one part that i've missed, which is why it's not working?

    cheers


  11. #11
    Member
    Join Date
    Feb 2005
    Location
    manchester, england
    Posts
    98
    can anybody help me please... this problem is driving me mad... i just can't see why the tab control isn't working (in the attached .fla file)!

    thanks


  12. #12
    Senior Member chi-styler's Avatar
    Join Date
    Jul 2001
    Location
    Bristol, UK
    Posts
    1,237
    To be honest I don't know why your original method isn't working, but if you're interested here is a working fla of my method.
    Attached Files Attached Files

  13. #13
    Member
    Join Date
    Feb 2005
    Location
    manchester, england
    Posts
    98
    thanks chi-styler... that'll do nicely!

    i'll try and figure out how it all works this weekend.

    how's Oxford these days...? i used to live just off Cowley Road a few years back...

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