[팁] textinput,textarea 입력 빠르게(한글개선) | Flex 컴포넌트 개발
2008.09.05 13:42
강원철(expand)
새싹멤버
http://cafe.naver.com/flexcomponent/12176
한글처리가 flex 에서 textinput 에서 한박자 늦게 써지는 답답함때문에 관련자료를 찾던중
아래와 같이 해결하거나 frameRate 의 속도를 높여 개선을 하는 방법이 있었는데 아래와 같은 방법이 저에게는 잘 적용이 안되더라구요. 에러가 나고 frameRate를 높일경우 메모리와 컴퓨터에 부하가 걸리기 때문에 디폴트 이상으로 높이기 싫고요.
기존 소스
<?xml version="1.0" encoding="utf-8"?>
<mx:TextInput xmlns:mx="http://www.adobe.com/2006/mxml" focusIn="TextInput_onFocusIn()" focusOut="TextInput_onFocusOut()">
<mx:Script>
<![CDATA[
private function TextInput_onFocusIn(): void
{
this.textField.alwaysShowSelection = true;
}
private function TextInput_onFocusOut(): void
{
this.textField.alwaysShowSelection = false;
}
]]>
</mx:Script>
</mx:TextInput>
개선안
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init();">
<mx:Script>
<![CDATA[
import mx.core.IUITextField;
private function init():void
{
var fname:IUITextField = uname.mx_internal::getTextField();
fname.alwaysShowSelection = true;
}
]]>
</mx:Script>
<mx:TextInput x="173" y="87" id="uname" tabIndex="0"/>
</mx:Application>