dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Keys

  1. #1
    Member
    Join Date
    May 2008
    Posts
    46

    Keys

    is there any way toactualy "record" the buttons that are pressed on my keyboard and then through a "play" button they virtualy press themselves again.

    same order and at the same time as they were pressed in real
    Don't blame me cuz' my English sucks ) i'm from romania XD

    www.xelubest.ro

  2. #2
    A Senior Newbie - How Odd ForumNewbie's Avatar
    Join Date
    Mar 2003
    Posts
    590
    Yes.

    I can't currently work out an easy way, but it's certainly possible.

    The slow way would be to add a keyboard event to every key on the keyboard. Each one should have a script on it, which would add that character to a string.

    That string would then be what you typed in, in the sequence you typed it.

    I'm trying to figure an easy way, to avoid having to do this for every key.

    M.
    Please note that my domain has changed to http://www.morganmultinational.com

  3. #3
    Member
    Join Date
    May 2008
    Posts
    46
    i would prefer the EACH KEY event thing :P

    i have just 18 keys

    xelu_best[at]yahoo[cot]com (IM chat)
    Don't blame me cuz' my English sucks ) i'm from romania XD

    www.xelubest.ro

  4. #4
    A Senior Newbie - How Odd ForumNewbie's Avatar
    Join Date
    Mar 2003
    Posts
    590
    Hi,

    For the 'each key' thing, simply add a Keyboard action. Add an event to that, so that on 'KeyDown' for the button 'A', it runs a script that says 'MyDataString = MyDataString +"A"' . Repeat for all 17 keys.

    A possible improvement would be to use the method in the attached movie, which only works in Flash 9, but uses a more structured method, and doesn't need each key individually scripting. It detects any button press, then finds the character code that relates to that button, and adds that character to the main data string. It must be exported to work properly.

    Hope this is of interest.

    Morgan.
    Attached Files Attached Files
    Please note that my domain has changed to http://www.morganmultinational.com

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