dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Check for certain key-press in a textfield..

  1. #1
    Howdy all..

    I have a lil prob here..

    I want to let flash execute a set if external functions (ASP) as soon as a user presses the ENTER-key (chr(13),chr(10)..?) inside an Input field. I tried on(something) and some other stuff, but to no avail. Cos this script only seems to work in button instances. Calling the external ASP scripts is no problem, but getting flash to respond on pressing the ENTER key inside that field seems a lil trickier..

    Any support would be greatly appreciated.

    thanks lots in advance

  2. #2
    Senior Member
    Join Date
    Oct 2001
    Posts
    354

    Maybe have a solution

    Try adding an invisible button with the On key release (enter)then after enter tell the button to check your input text(variable).
    Like
    on (keyPress "<Enter>") {
    if (your variable eq"sometext") {
    gotoAndPlay (2);
    } else {
    gotoAndPlay (3);
    }
    }

    Anyways it's like as long as they have clicked somewhere in the movie clip (such as the text field), the button which they can't see will go to a different frame depending on what they typed. then you can tell that frame to get the asp.I hope this helps if not, what can I say I'm a newbie.

  3. #3
    Member
    Join Date
    Oct 2001
    Posts
    44

    resolved

    Make this input field a movie clip, and add this action

    Code:
    onClipEvent (keyDown) {
     if (Key.isDown(Key.ENTER)){
          ......... // some action	
    	}
      }
    ZeroIQ

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