A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: Onscreen Keyboard

  1. #1
    Senior Member
    Join Date
    May 2001
    Posts
    102

    Lightbulb

    Does anyone know how to create an onscreen keyboard or can someone atleast point me in the right direction to creating one? Thanks!

  2. #2
    Senior Member
    Join Date
    May 2002
    Posts
    253
    can you explain this a little further in detail?

  3. #3
    Senior Member
    Join Date
    May 2001
    Posts
    102
    Ok... I'm making a touch screen Kiosk and it has no keyboard. There is a certain section that needs user inputs in certain textbox's. As a result... im trying to make a an onscreen keyboard that acts like a regular keyboard. I actually only need it for numeric inputs.

  4. #4
    Senior Member
    Join Date
    May 2002
    Posts
    253
    well just make the keys seperate buttons and then set the actions to on(keyPress) and associate the buttons with the keys.

  5. #5
    Senior Member
    Join Date
    May 2001
    Posts
    102
    Originally posted by TranslucentDesign
    well just make the keys seperate buttons and then set the actions to on(keyPress) and associate the buttons with the keys.
    Hmmm.. how would that work? I have no keyboard to press the keys that are going to be associated with the on(keyPress) actions. Essentially, im making a functional keyboard on the screen and not just be a visual representation of the keys being pressed.

  6. #6
    Senior Member
    Join Date
    Jul 2002
    Posts
    153
    For each key (button instance) use the following code:

    Code:
    on (release) {
    	var_name += "a"
    }
    This will add the letter "a" to the variable var_name. If the user presses another button (for example "l") the var will add the "l" after the "a" and you get "al".

    Backspace will require something different, you will need to run a script to figure out the length of the variable and chop off the last letter.

    Off the top of my head I cant reproduce the code to do this, anyone out there that can help?

    -John

  7. #7
    Senior Member
    Join Date
    May 2001
    Posts
    102
    Originally posted by jmdesigns
    For each key (button instance) use the following code:

    Code:
    on (release) {
    	var_name += "a"
    }
    This will add the letter "a" to the variable var_name. If the user presses another button (for example "l") the var will add the "l" after the "a" and you get "al".

    Backspace will require something different, you will need to run a script to figure out the length of the variable and chop off the last letter.

    Off the top of my head I cant reproduce the code to do this, anyone out there that can help?

    -John

    Hmmm... this seems like it will work, but I haven't tried it. Quick question... Will this work on any input textbox that they click on?

  8. #8
    Senior Member
    Join Date
    Jul 2002
    Posts
    153
    Not without more code, there may be better ways of doing this, but I would think about trying this:

    Have each field in its own MC, use hit test to determine what MC the user has clicked on and then have a variable change determining what text field has 'focus'. Then in my button code I would use some an if/else to find out the value of my variable that tells me what text field was hit. From there do the var_textfieldname += "a".

    Haven't played with it yet but the focus commands in flash (mx at least) may even save a few steps here..

    -John

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