<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Howtos &#187; textfield</title>
	<atom:link href="http://howto.isgoodness.com/tag/textfield/feed/" rel="self" type="application/rss+xml" />
	<link>http://howto.isgoodness.com</link>
	<description>Stuffs that are worth to mention and worth to know</description>
	<lastBuildDate>Sun, 27 Feb 2011 16:19:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Howto use vnkeys with TextField</title>
		<link>http://howto.isgoodness.com/2009/11/howto-use-vnkeys-with-textfield/</link>
		<comments>http://howto.isgoodness.com/2009/11/howto-use-vnkeys-with-textfield/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 21:00:06 +0000</pubDate>
		<dc:creator>Van Nhu</dc:creator>
				<category><![CDATA[vnkeys]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[key converter]]></category>
		<category><![CDATA[textfield]]></category>
		<category><![CDATA[typing vietnamese]]></category>

		<guid isPermaLink="false">http://howto.isgoodness.com/?p=310</guid>
		<description><![CDATA[vnkeys is originally designed to work with flash.text.TextField and you can feel it when typing. The replacement happens smoothly. It is easy to use and the code bellow will explain how to&#8230; package &#123; import flash.display.Sprite; import flash.text.TextField; import flash.text.TextFieldType; &#160; import org.vnmedia.vnkeys.KeyConverter; import org.vnmedia.vnkeys.mapping.VNIMap; // define swf dimension &#91;SWF&#40;width=160, height=60&#41;&#93; // this is an [...]]]></description>
			<content:encoded><![CDATA[<p>vnkeys is originally designed to work with flash.text.TextField and you can feel it when typing. The replacement happens smoothly. It is easy to use and the code bellow will explain how to&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span> <span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">Sprite</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.text</span>.<span style="color: #004993;">TextField</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.text</span>.<span style="color: #004993;">TextFieldType</span>;
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.vnmedia.vnkeys.KeyConverter;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.vnmedia.vnkeys.mapping.VNIMap;
	<span style="color: #009900;">// define swf dimension</span>
	<span style="color: #000000;">&#91;</span>SWF<span style="color: #000000;">&#40;</span><span style="color: #004993;">width</span>=<span style="color: #000000; font-weight:bold;">160</span>, <span style="color: #004993;">height</span>=<span style="color: #000000; font-weight:bold;">60</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
	<span style="color: #009900;">// this is an application class</span>
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> vnmedia_vnkeys extends <span style="color: #004993;">Sprite</span>
	<span style="color: #000000;">&#123;</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> vnmedia_vnkeys<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> textinput<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">TextField</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">TextField</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #009900;">// give this text input a size</span>
			<span style="color: #009900;">// and positioning it</span>
			textinput.<span style="color: #004993;">width</span> = <span style="color: #000000; font-weight:bold;">150</span>;
			textinput.<span style="color: #004993;">height</span> = <span style="color: #000000; font-weight:bold;">50</span>;
			textinput.<span style="color: #004993;">x</span> = <span style="color: #000000; font-weight:bold;">5</span>;
			textinput.<span style="color: #004993;">y</span> = <span style="color: #000000; font-weight:bold;">5</span>;
			<span style="color: #009900;">// use multiline, ie textarea</span>
			textinput.<span style="color: #004993;">multiline</span> = <span style="color: #0033ff; font-weight: bold;">true</span>;
			textinput.<span style="color: #004993;">type</span> = <span style="color: #004993;">TextFieldType</span>.<span style="color: #004993;">INPUT</span>;
			<span style="color: #009900;">// give it background white</span>
			<span style="color: #009900;">// so we can see what we are typing</span>
			textinput.<span style="color: #004993;">backgroundColor</span> = 0xFFFFFF;
			textinput.<span style="color: #004993;">background</span> = <span style="color: #0033ff; font-weight: bold;">true</span>;
			<span style="color: #009900;">// NOW create a converter</span>
			<span style="color: #009900;">// for this TextField instance</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> converter<span style="color: #000000; font-weight: bold;">:</span>KeyConverter =
				<span style="color: #0033ff; font-weight: bold;">new</span> KeyConverter<span style="color: #000000;">&#40;</span>textinput,VNIMap.NAME<span style="color: #000000;">&#41;</span>;
			<span style="color: #009900;">// add this text input to application</span>
			<span style="color: #0033ff; font-weight: bold;">this</span>.<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>textinput<span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>The result:<br />
<object style="width: 160px; height: 60px;" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="160" height="60" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="scale" value="exactfit" /><param name="src" value="http://howto.isgoodness.com/wp-content/uploads/2009/11/vnmedia_vnkeys.swf" /><embed style="width: 160px; height: 60px;" type="application/x-shockwave-flash" width="160" height="60" src="http://howto.isgoodness.com/wp-content/uploads/2009/11/vnmedia_vnkeys.swf" scale="exactfit"></embed></object><br />
Type using <a href="http://howto.isgoodness.com/2009/10/how-to-type-vietnamese-with-vni-input-method-that-implemented-in-vnkeys/">VNI input method</a></p>
]]></content:encoded>
			<wfw:commentRss>http://howto.isgoodness.com/2009/11/howto-use-vnkeys-with-textfield/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

