Powered by InterCreatives | Site Map
Search:
NewSourceMedia Popular Tutorials: PHP Javascripts Web Hosting
SoftwareTutorials
CATEGORIES
Job Listings
 
Home / Flash /

Fix flash focus to activate key clicks.


Question: How do I initiate the flash with out using the mouse click. For example I built a flash game utilizes the keyboard as the main controller and I want the flash game to listen for the key clicks to move the item in the game. The problem is when the page loads, flash does not have the focus so clicking on any key only controls the browser window and not the flash.

Answer: Use a JavaScript call on the body tag “onLoad” event like below to set the focus on the flash game using the flash embed id name like so:

<body onLoad="window.document.flashIDname.focus();">

flashIDname = The is the name of flash movie without the ".swf".


Next Flash Page:
1  2  3  4  5  6  7  8  [9]  10 





Hosting by iPowerWeb.com - 50 Gb for $7.95