Flash + Unity Focus

Hey guys,

I have Flash and Unity talking just fine to each other through jQuery, but I have an issue. As soon as I click a Flash button, the Unity player stops because the focus is now on the Flash movie. The Unity player doesn’t do anything until I’ve clicked it again. My question is: How do I immediately return focus to the Unity player after I’ve clicked the Flash button?

Thanks so much!

tell flash to instruct a js function in the page to focus the unityengine embed again.
that or set the webplayer to run in background then it won’t stop

Thanks. I think option 1 fits my needs a little better. Can you show me the .js code for focusing on the unityengine embed?

javascript has the function .focus()

problem with it is that I’m unsure if it really leads to unity getting focus out of its view as it is bound to mouse input normally

Yeah, focus() isn’t doing anything for me, unfortunately.

in that case I would actually do the opposite:

don’t have the play button but instead use an externalcall / externaleval to inform the flash plug to play the movie and make it call back in once done and put the unity webplayer to sleep inbetween (target framerate to 1, timeScale to 0 for example)

You should enable unity to run in background. Job done !

-Jedy