I've been trying to set up this test page for my flash game but it refuses to gain focus on load. I read a bunch of forum entries and didn't get it to do anything, I can't really believe this should be so hard.
Here's what I have:
<head>
<title>UP HERE WE ESCAPE THE RAT RACE</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
<script type="text/javascript">
swfobject.embedSWF("UpHere.swf", "myContent", "700", "300", "9.0.0");
function setFocusOnFlash() {
var fl = document.getElementById("myContent");
if (fl) { fl.focus(); }
}
</script>
</head>
<body onload="setFocusOnFlash()">
<div style="margin:0 auto; text-align:center; width:700px;">
<div id="myContent" style="margin:0 auto; text-align:center; width:700px;">
<p>Alternative content</p>
</div>
</div>
</body>
You can see it live here, http://joon.be/exclusivepreview/
what's wrong with it? I don't have a very deep knowledge of swfObject...