it's probably better to use the callback function (requires swfobject 2.2) <script type="text/javascript">
swfobject.embedSWF("transporter_prototype.swf", "content", "1280", "820",
"9.0.0", false, {}, {}, {}, setFocusOnFlash);
function setFocusOnFlash() {
var fl = document.getElementById("content");
if (fl){ fl.focus(); }
}
</script>
also, setting focus on non-form elements generally only works in internet
explorer. (haven't tested myself lately)
http://kb2.adobe.com/cps/155/tn_15586.html
- philip
On Wed, Jan 13, 2010 at 3:34 PM, Travis Schmeisser <[email protected]>wrote:
> I'm following the instructions here, but an unable to bring focus to
> the flash movie:
>
>
> http://groups.google.com/group/swfobject/browse_thread/thread/37db16534056b8ad/01c49ef2e94afaf9
>
> Here's my code referencing a div with the id "content"
>
> <head>
> <title>Transporter Prototype</title>
> <meta http-equiv="Content-Type" content="text/html;
> charset=iso-8859-1" />
> <script type="text/javascript" src="swfobject.js"></script>
> <script type="text/javascript">
> swfobject.embedSWF("transporter_prototype.swf", "content",
> "1280", "820", "9.0.0");
> function setFocusOnFlash() {
> var fl = document.getElementById(content);
> fl.focus();
> }
> }
> swfobject.addDomLoadEvent(setFocusOnFlash);
> </script>
> </head>
> <body>
> <div id="content">
> <p>Prototype</p>
> </div>
> </body>
>
> Can you see what I'm doing wrong? Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "SWFObject" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<swfobject%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/swfobject?hl=en.
>
>
>
>
-- You received this message because you are subscribed to the Google Groups "SWFObject" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/swfobject?hl=en.
