Is there anyway to give Flash focus in a browser without required the user to click it?

一笑奈何 提交于 2019-12-19 09:45:00

问题


I have a flash (flex) web application and when it first loads the cursos is in the username field blinking. However, you can't start typing because Flash does not have focus. You have to first click on the flash app. Is there anyway to give Flash focus on load? Would this be in the html or in flash?

Thanks.


回答1:


You should use Javascript. Here's an official how-to: http://kb2.adobe.com/cps/155/tn_15586.html




回答2:


The method linked by Zilupe described in the note is for Windows IE only, probably not good enough.

I haven't tried this myself and for the comments on the page it seems it's not reliable, but check this out: Firefox Focus and Actual Links.

This is a very annoying problem that effectively kills any accessibility efforts you might have put in your Flash application. Blind users using non-IE browsers will NOT be able to use your app because they simply cannot click on it to give it the focus.

Last time I investigated the problem I found a comment by some FF developer stating that it was actually Mozilla's fault (sorry, lost the link) but I honestly don't care. Adobe should chase up Mozilla and put some effort to fix this, it's on Adobe's interest.




回答3:


Check out SWFObject. For security reasons FLASH never is auto focus - otherwise stealing keyboard input would be a snap.



来源:https://stackoverflow.com/questions/892879/is-there-anyway-to-give-flash-focus-in-a-browser-without-required-the-user-to-cl

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!