<body onload="document.getElemen
Main Topics
Browse All TopicsHi,
I want to set focus on my flash file when the page loads.
I am using focus() method in javascript and its working fine in IE and Firefox.
how would i focus on my flash file on load. so that i can use tab keys to access buttons on the flash file.
here is a link to my working file:
http://nma.couchcreativede
in short i need a javascript code which will enable safari to set focus on the flash file on page load.
thanx in advance
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Hi clarions979,
Sorry for the delay. Possible post some of your code snippet regarding the focus event that resides?
You can try check DOM's "document.ready" event before load the focus event as suggested above.
I'm using JQuery framework to verify it readiness
http://snippets.dzone.com/
JQuery
=========
document).ready(function()
// put all your jQuery/javascript goodness in here.
});
now iam getting realy fed up of this safari bug ...
i have been trying to fix this for last 5, 6 days .. but not even getting closer to solving this issue
x-com: i have tried ur thing aswell .. doesn't wana work ..
i even inlcuded a javascript function which would be called from inside the flash file when its loaded.. but some how .. the .focus thing doesn't seem to work
please help!
here is what i am doing at the moment :
Ok, can you create a very simple page and perform the "focus" checking. See if the focus property working properly in Safari.
eg:
html
=======
<html>
<script>
function setFocusOnFlash()
{
var myFlash = document.getElementById( 'flashcontent' );
if ( myFlash ) { myFlash.focus(); }
}
setFocusOnFlash();
</script>
<body>
<div id='flashcontent'>Testing..
</body>
</html>
Hmm, it seem like Safari's behaviour limitations for setting focus on flash object.
http://www.robrusher.com/2
Perhaps Safari should release its patch to resolve this issue.
Business Accounts
Answer for Membership
by: x_comPosted on 2009-06-12 at 02:42:41ID: 24610537
Hi clarions979,
uestions/5 94821/obje ct-focus- p roblem-wit h-safari-a nd-chrome- browsers
Make sure the page is fully rendered before you set focus on the flash object.
eg:
....//your html code...
<!-- put focus event at end of the page -->
<script>
var myFlash = document.getElementById( 'flashcontent' );
if ( myFlash ) { myFlash.focus();}
</script>
Check this similar post:
http://stackoverflow.com/q