...

View Full Version : <object id="idName">



fumeng
03-21-2005, 03:59 PM
hi.

i'm assigning an "id" attribute in my object tag via:

<object id="idName">

it's for an embedded flash movie. on my cfm page i have this code:
<head>
<script>
<!--
//sets focus on the flash movie
function focusFlash()
{
document.all.idName.setFocus();
}

and then in the body tag i invoke this function:
<body onLoad="focusFlash();">

but i'm getting an error in IE that says:
"Object doesn't support this property or method"

i can see that the "id" tag is supported on the w3cschools.com site. so where might the error message be coming from ?

any ideas? all help is greatly appreciated.

thanks.

fumeng.
-->
</script>
</head>

mcdougals4all
03-21-2005, 04:54 PM
Object doesn't support this property or method

Shouldn't be a problem with the <object> id. From the error message, it appears <object> does not support the focus method.

fumeng
03-21-2005, 05:03 PM
hi :: thanks for responding to my post so quickly, i really appreciate that. you're exactly right, i was calling setFocus(), which is a native flash method, instead of the correct javascript method, focus(). so now it works perfectly. thank you very much for your help.

by the way, do you know about setting focus to a flash movie in mozilla-based browsers? this is essentially what i'm trying to do in this exercise. i don't use an object tag, rather an <embed> tag. but i use the "name" attribute instead of "id" and i set "swLiveConnect=true". this is all from what i've read, but it still isn't working. do i need to change my focusFlash() method?

thanks.

fumeng.

mcdougals4all
03-21-2005, 05:12 PM
:thumbsup: No problem.

Can't help with the rest of your question though... :)

fumeng
03-21-2005, 05:14 PM
no worries. thanks again for your help.

best,

fumeng.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum