AS3 Virtual Keyboard is a library to display in-app virtual keyboard for user input. The virtual keyboard is similar to the one available on the Android/iOS platform, emerging from the bottom of the screen.
Some of it features include auto resize, auto align and dynamic key configuration. This lib is useful to allow user input on touch enabled games.
Sample
package { import flash.display.Sprite; import flash.events.MouseEvent; import flash.text.TextField; import flash.text.TextFormat; import nid.ui.controls.VirtualKeyBoard; /** * ... * @author Nidin P Vinayakan */ public class Main extends Sprite { public function Main() { VirtualKeyBoard.getInstance().init(this); var txt:TextField = new TextField(); txt.width = 300; txt.height = 100; txt.background = true; txt.backgroundColor = 0xCCCCCC; txt.defaultTextFormat = new TextFormat("Arial", 25, 0x000000,true,null,null,null,null,"center"); txt.text = "PRESS HERE" addChild(txt); txt.x = 175; txt.y = 10; txt.addEventListener(MouseEvent.CLICK, toggleKeyboard); } private function toggleKeyboard(e:MouseEvent):void { VirtualKeyBoard.getInstance().target = { field:e.currentTarget, fieldName:"Test" }; } } }
hi, I downloaded and try to use this. However,after I path it to the source folder of AS3 Virtual Keyboard, i found that there are errors in it. One error is about Arial and the other is about tweener not found. Can you help me with this?
Oppsss… worry. It was a stupid mistake on my side. Sorry 😛
No problem! 😀 Nice you figured it out all by yourself.
Hello, thank you for making this available.
I’m trying to add special characters (ñ, á, ü), so I modified KeyBoardUI.as but think I’m missing visual feedback (key registers correctly).
Can you point me on the correct track please?
Regards
Hey there! I’m not the author of that lib, so this is much more of hunch than a tip: are you embedding all the font glyphs so the textfield can render them properly? I had similar problems in the past and they were all related to glyphs embedding.
You could also try to ping the author of the lib. He probably has a lot more to offer regarding your question.