enter or return troubles

Ask a Question related to Macromedia Director Basics, Design and Development.

  1. #1

    Default enter or return troubles

    I've made a simple application that generates random words. The user can
    specify how many words he needs generated by typing a number into a field.
    Now I'm trying to add a simple behavior that lets the user use the
    return-button on the keyboard instead of having to click on the 'generate'
    button with the mouse.

    I'v tried this :

    on exitframe
    if keyPressed(return) then
    gSet = (item 1 of field "fld_howmany").integer
    Selector
    end if
    end

    (gSet holds the number of items to be generated, while Selector is a custom
    handler that does the generating.)

    When I use the return key, it works like a charm. It also works when I press
    the enter-key near the keypad, but strangely enough it also leaves a little
    square in the textfield! I have no idea where this square comes from.

    Could someone please explain this to me ? Or maybe how to do it properly ?




    Somnifer Guest

  2. Similar Questions and Discussions

    1. FMS troubles
      I'm trying to troubleshoot an app that is using FMS. It works fine for me, but my client is behind a pretty secure firewall. I had them do the port...
    2. Preventing a form submitting by hitting return/enter
      I'm working on a form that includes asp:textbox and asp:radiobuttonlist items. When the page is rendered in a browser and the focus is on one of...
    3. can I use enter as a tab?
      hi, can I somohow make the ENTER key work as the TAB key in Flash 5? so that in a form when I press ENTER I don't send the module but I pass to...
    4. Launching a script from a carriage return <cr> or "Enter" key
      Hi All, I have a db I wrote a year ago and I need to tweek some functionality. I'm running with FM Pro v6.4 Question is: Can a script be...
    5. Tab to Enter
      Hi All, I want to change default tab key with return (enter) key when move from one text box into another text box, is this possible in web form,...
  3. #2

    Default Re: enter or return troubles

    the square is a result or director trying to display the cariage-return or
    line feed character as a visual character,
    the font does not have this character as a visual so it places the box in
    there, Its like a missing-character character




    "Somnifer" <somnifer@pandora.be> wrote in message
    news:c7fqj4$1rb$1@forums.macromedia.com...
    > I've made a simple application that generates random words. The user can
    > specify how many words he needs generated by typing a number into a field.
    > Now I'm trying to add a simple behavior that lets the user use the
    > return-button on the keyboard instead of having to click on the 'generate'
    > button with the mouse.
    >
    > I'v tried this :
    >
    > on exitframe
    > if keyPressed(return) then
    > gSet = (item 1 of field "fld_howmany").integer
    > Selector
    > end if
    > end
    >
    > (gSet holds the number of items to be generated, while Selector is a
    custom
    > handler that does the generating.)
    >
    > When I use the return key, it works like a charm. It also works when I
    press
    > the enter-key near the keypad, but strangely enough it also leaves a
    little
    > square in the textfield! I have no idea where this square comes from.
    >
    > Could someone please explain this to me ? Or maybe how to do it properly ?
    >
    >
    >
    >

    Greg Brant Guest

  4. #3

    Default Re: enter or return troubles

    "Somnifer" <somnifer@pandora.be> wrote in
    news:c7fqj4$1rb$1@forums.macromedia.com:
    > When I use the return key, it works like a charm. It also works when I
    > press the enter-key near the keypad, but strangely enough it also
    > leaves a little square in the textfield! I have no idea where this
    > square comes from.
    >
    > Could someone please explain this to me ? Or maybe how to do it
    > properly ?
    I would trap the key in the keyDown event. That way you can completely
    prevent it from getting into the field or text member. Something like:

    on keyDown me
    if (the key = RETURN) or (the key = ENTER) then
    do something
    else
    PASS
    end if
    end


    --
    Mark A. Boyd
    Keep-On-Learnin' :)
    Mark A. Boyd Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139