Flex设置自动获得焦点
发布时间:2020-12-15 04:25:05 所属栏目:百科 来源:网络整理
导读:protected function initializeHandler(event:FlexEvent):void{ ExternalInterface.call("document.getElementById('logClient').focus()"); focusManager.setFocus(loginName);} s:TextInput id="loginName" maxChars="250" width="150"/ 'logClient 为该FL
protected function initializeHandler(event:FlexEvent):void { ExternalInterface.call("document.getElementById('logClient').focus()");
focusManager.setFocus(loginName);
}
<s:TextInput id="loginName" maxChars="250" width="150"/> 'logClient
为该FLEX页面在HTML中的ID,或者就是你这个FLEX页面的名称 如何获得这个名称: 在页面的查看源文件中,有这样一段话:
<noscript> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%" id="logClient"> <param name="movie" value="logClient.swf" /> <param name="quality" value="high" /> <param name="bgcolor" value="#ffffff" /> <param name="allowScriptAccess" value="sameDomain" /> <param name="allowFullScreen" value="true" /> <!--[if !IE]>--> <object type="application/x-shockwave-flash" data="logClient.swf" width="100%" height="100%"> <param name="quality" value="high" /> <param name="bgcolor" value="#ffffff" /> <param name="allowScriptAccess" value="sameDomain" /> <param name="allowFullScreen" value="true" /> <!--<![endif]--> <!--[if gte IE 6]>--> <p> Either scripts and active content are not permitted to run or Adobe Flash Player version 10.2.0 or greater is not installed. </p> <!--<![endif]--> <a href="http://www.adobe.com/go/getflashplayer"> <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash Player" /> </a> <!--[if !IE]>--> </object> <!--<![endif]--> </object> </noscript>上面的ID找到。 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |