A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Press Enter key instead of button click...

  1. #1
    Junior Member
    Join Date
    Nov 2004
    Location
    Ireland
    Posts
    2

    Press Enter key instead of button click...

    Hey all,

    Any help would be much appreciated..
    I have an application where a search is done on a members table from a database! The User enters in a person they are looking for but then they have to click on the button adjacent to the textarea! I am looking for some code to have the "Search" button highlighted so that when the user presses enter after inputting their search criteria the query is done and the expected results are returned..
    I am using Flash MX 2004 Pro with Actionscript 2!!

    Thanks again for having a look at my problem..

    Kinnego
    kinnego

  2. #2
    <b>Hi i have attached a file that shold help it incorperates a butten with the following code</b>
    ----------------------------------------

    on (keyPress "<Enter>") {
    goto(2);
    }
    on (press) {
    gotoAndStop(3);
    }

    ----------------------------------------
    I hope this helps?
    Attached Files Attached Files

  3. #3
    Senior Mender trionik's Avatar
    Join Date
    Nov 2000
    Location
    Montréal,Canada
    Posts
    1,077
    var keyListener = new Object();
    keyListener.__main = this;
    keyListener.onKeyUp = function ()
    {
    if(Key.getCode() == Key.ENTER)
    {
    this.__main.yourButton.onRelease();
    }
    }
    _global.main.acKeyListener = keyListener;
    Key.addListener(keyListener);

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