title: Return Focus to a Flash App...?
body: <p>I have an interactive flash app on my website - the app and the website are both under my control, so I can edit both of them (that is, this isn't a user-submitted content site, where I could maybe only control the game content, or just the website).</p>
  
  <p>This is the flash app's embed code:</p>
  
  <pre><code>&lt;object name="flashApp" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="FlashApp" width="600"  height="600" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"&gt;   
      &lt;param name="movie" value="apps/1234.swf" /&gt;
      &lt;param name="allowScriptAccess" value="sameDomain" /&gt;
      &lt;embed src="apps/1234.swf" width="600"  height="600" quality="high" name="exampleApp" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer"&gt;
      &lt;/embed&gt;
  &lt;/object&gt;
  </code></pre>
  
  <p>Around the flash app are several links that allow the user to click things which perform javascript actions that modify the flash content. The javascript communicates with the flash app, and the app communicates with the javascript.</p>
  
  <p>One small problem I'm having though, is that when the user clicks one of the javascript buttons or links, focus is lost from the flash app. For example, they might click "Learn about X" (one of the javascript links), and the flash app will proceed, but when the user tries to use the arrow keys after that, nothing happens in the flash app. Instead the user must click back inside the flash app first before using the keyboard again.</p>
  
  <p>What I'd like is a javascript function that can be called in order to restore keyboard and mouse focus to the flash app <strong><em>and which will work in IE, Firefox, and Chrome</em></strong>.</p>
  
  <p>Any ideas?</p>