I have developed a simple interactive Flash game, but now it appears that sometimes Flash Adds (3rd party ones displayed by facebook) somehow steal the focus from my flash application (by mistake?). My app has textfield() where the focus should remain until game is over.
My flash object uses urlrequest/javascript to ask for focus at startup (it works with IE and Firefox) but it seem that focus can be easily stolen. What should I do to get the focus always back when its lost and/or how to make sure other flash app is not stealing it?
Also my javascript focus request is currently not working with Safari/Crome browser, so what is most compatible way to request focus and keep it?
I’ve never had to deal with your specific situation (and I’ve never heard of it happening either, but nore have I had to fight with other Flash objects on a web page), but what if you were to listen for MouseEvent.FOCUS_OUT on your text field and then set a one-shot timer for, say, 250ms, which upon firing would then take the focus back (using whatever JavaScript you might need to convince the browser to give you the focus again).
Unfortunately I don’t know enough about integration with Safari or Chrome to help you with your second question.