Flex的TextInput控件中如何让光标显示出来
<?xmlversion="1.0"encoding="utf-8"?><!--events/TrapAllKeys.mxml--><mx:Applicationxmln...
<?xml version="1.0" encoding="utf-8"?>
<!-- events/TrapAllKeys.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" initialize="initApp()">
<mx:Script><![CDATA[
private function initApp():void {
myAccountInput.focusEnabled = true; //可以接受焦点
myAccountInput.setFocus();
myAccountInput.drawFocus(true);
}
private function keyHandler(event:KeyboardEvent):void {
}
]]></mx:Script>
<mx:TextInput id="myInput" width="122" height="24" maxChars="32" editable="true" enabled="true"
color="#02FE02" fontSize="11" fontWeight="bold" textAlign="left" backgroundAlpha="0.0"
alpha="1.0" themeColor="#0B2D42" borderStyle="none" left="24" top="25" fontFamily="Arial"/>
</mx:Application>
请问这样可以让焦点在控件textInput中么,如果不能,怎么才能让焦点(Focus)自动在控件textInput中,并且显示焦点在控件textInput中时应有的闪烁的光标??? 跪求答案啊。。。。。 展开
<!-- events/TrapAllKeys.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" initialize="initApp()">
<mx:Script><![CDATA[
private function initApp():void {
myAccountInput.focusEnabled = true; //可以接受焦点
myAccountInput.setFocus();
myAccountInput.drawFocus(true);
}
private function keyHandler(event:KeyboardEvent):void {
}
]]></mx:Script>
<mx:TextInput id="myInput" width="122" height="24" maxChars="32" editable="true" enabled="true"
color="#02FE02" fontSize="11" fontWeight="bold" textAlign="left" backgroundAlpha="0.0"
alpha="1.0" themeColor="#0B2D42" borderStyle="none" left="24" top="25" fontFamily="Arial"/>
</mx:Application>
请问这样可以让焦点在控件textInput中么,如果不能,怎么才能让焦点(Focus)自动在控件textInput中,并且显示焦点在控件textInput中时应有的闪烁的光标??? 跪求答案啊。。。。。 展开
3个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询