how to use vnkeys with flex

In the package org.vnmedia.flex we find two subclasses of Flex controls class. FlexTextInput is extending TextInput and FlexTextArea extending TextArea. Those two inherit all functionalities from their parent. We just added some more code handling the typing since TextInput and TextArea behaves unlike TextField. It is simple to use. You just need to declare namespace for org.vnmedia.flex, I call it “flex” in example bellow.

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" 
	xmlns:flex="org.vnmedia.flex.*"
	layout="absolute">
	<flex:FlexTextArea id="area" vnkeyType="VNI" 
		height="50" width="220" x="50" y="50">
	</flex:FlexTextArea>
	<flex:FlexTextInput id="text" y="120"
		 x="50" width="220">
	</flex:FlexTextInput>
</mx:Application>

You can type vietnamese using VNI input method (see)

vnkeys was designed to work well with Textfield. I guess that you feel that the replacement is a little bit annoying when using it with Flex TextInput and TextArea. Here is an example when using it with TextField. It runs smoothly and you experience a bit faster. This is something that we will try to improve in the future version.

One Comment

  1. [...] as the swf above. To create TextArea and TextInput we use input components that follows vnkeys (see this how to for details). Bellow is our code example where we use flex RadioButtonGroup and RadioButton to [...]