我在处理TextArea上的单击事件时遇到了问题。我正在开发一个使用Flash Mobile的移动应用程序。我想在该区域中显示默认文本,并在用户选择该字段时使其消失。
问题是,只有当我单击TextArea的边框时才会抛出事件。当选择光标处于活动状态时,不会发生这种情况。我还尝试向notesInput添加一个错误的可编辑属性,并在处理程序中将其设置为true,但没有任何帮助。
private function notesClickHandler(event:Event):void{
notesInput.text = "";
notesInput.removeEventListener(MouseEvent.CLICK, notesClickHandler);
form.invalidElements;
}
<TextArea id="notesInput" text="Poznámky.."
height="150" width="100%"
verticalScrollPolicy="auto"/>感谢你们的时间和帮助。
发布于 2014-12-09 04:21:05
为此,您可以使用如下所示的focusIn事件:
private function text_area_focusInHandler(event:FocusEvent):void
{
text_area.text = ''
}
<s:TextArea id="text_area" x="10" y="10" focusIn="text_area_focusInHandler(event)" text="default text"/>https://stackoverflow.com/questions/27365939
复制相似问题