Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Javascript Error: focus is not a function ...

Status
Not open for further replies.

jce1975

Programmer
Oct 8, 2004
11
US
I am trying put the focus onto a flash piece on a html page. I keep getting an error saying that window.document.mymovie.focus is not a function. Here are the code snippets:

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

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase=" width="540" height="433" id="mymovie" name="mymovie">
<param name="movie" value="../swfs/ambulance.swf">
<param name=quality value=high>
<embed src="../swfs/ambulance.swf" quality=high pluginspage=" type="application/x-shockwave-flash" width="540" height="433" id="mymovie" name="mymovie"></embed>
</object>

Any help would be greatly appreciated!

- James
 
AFAIK, You cannot give focus to a Flash movie. Thus the "focus is not..." error message you are seeing.

Why would you want to give focus to a Flash movie, anyway?

Hope this helps,
Dan



[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
I need this flash movie to be 508 compliant for the blind. So, I need to be able to tab through each of my buttons. If focus is not on the flash movie, tabbing just skips right over it!

This cannot be done?!

Thanks,

James
 
This cannot be done (in the way you have outlined).

What you basically want to do is use TAB to tab through the HREFs on the page... and when you come across the Flash movie, you want to be able to keep pressing TAB to cycle through the "buttons" in the Flash movie... eventually leaving the Flash movie and continuing to tab through the rest of the page contents.

I don't use Flash when considering an "accessible" solution. I don't see them as accessible (in general).

I would suggest including some alternative content in place for those that do not (or cannot) use Flash.

Cheers,
Jeff

[tt]Jeff's Page @ Code Couch
[/tt]

What is Javascript? FAQ216-6094
 
Thanks, Jeff.

Unfortunately, the whole site is done in flash, I am required to make the site 508 compliant and I do not have the option of making alternative content in this case.

Am I doomed?

-James
 
I know nothing about flash but would it work if you were to put the flash piece inside a container you CAN set focus to?
Would tabbing then go automatically to the flash object?


Paranoid? ME?? WHO WANTS TO KNOW????
 
maybe you should ask this in the flash forum (forum250). there should be some way, on page load, that you can set the focus inside the flash movie, using actionscript or whatever it is flash uses.

*cLFlaVA
----------------------------
[tt]I already made like infinity of those at scout camp...[/tt]
[URL unfurl="true"]http://www.coryarthus.com/[/url]
[banghead]
 
I am testing this on both the latest version of IE and the latest version of Firefox. In IE it works, but Firefox it doesn't. I am getting the javascript error from the Javascript Console in Firefox.

Thanks,

James
 
I must have missed that part after all the searching and reading I did ... thanks for resolving the issue.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top