A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [RESOLVED] Is this achieved with Listeners?

  1. #1
    Senior Member
    Join Date
    Jan 2007
    Location
    Barcelona
    Posts
    389

    resolved [RESOLVED] Is this achieved with Listeners?

    I am trying to build a game and I can't get past the login frame when I try to have the username textfield focused and the enterkey as well if the username is not undefined, but I can't manage to get any results. This doesn't work, obviously
    :upset: and if i use setDefaultPushButton, I can't have the focus on the input textField.

    Does anyone have an idea of how it is done?


    Selection.setFocus("username_txt");

    var usernameListener:Object = new Object();
    usernameListener.onChanged = function(){
    if (username_txt.length > 3 && username_txt.length < 15) && (Selection.getFocus == username_txt){
    Selection.getFocus(KeyListener);
    }
    }

    username_txt.addEventListener(usernameListener);

    var keyListener:Object = new Object();
    keyListener.onKeyDown = function(ev) {
    if (Key.isDown(Key.ENTER)) {
    login(username);
    }
    };

    Key.addListener(keyListener);

  2. #2
    Senior Member
    Join Date
    Aug 2006
    Posts
    322
    i am not going through your script....

    but the tips is if you are using for a nokia device use softkeys to login instead of the ENTER key

    I think I not missed what you are asked for


    marlopax

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