Order Now AdSolution Sign Up | Login » Bits on the Run Sign Up | Login »

Forums

/

IE: Object doesn't support this property or method

36 replies [Last post]

I have searched the forums ...I have searched the forums and read everything I can find on this. It seems the most common problem is folks naming their container div the same thing they name their movieplayer / flashvar / etc. I have made sure I'm not making that mistake.

In Firefox, everything is fine.

In IE, I get the "Object doesn't support this property or method" error.

The code where my movie is embedded:

<div id="container">
<embed type="application/x-shockwave-flash" src="mediaplayer.swf" width="352" height="240" allowscriptaccess="always" allowfullscreen="true" id="video1" name="video1" flashvars="height=240&width=352&file=cc_03_04_08.flv&bufferlength=8&volume=100&javascriptid=video1&
autostart=false&enablejs=true" />
</div>

Any time I try to communicate with the movie via the 'sendEvent' JS function, IE complains.
I am referring to the sendEvent JS function that is provided as basic use, in the three functions:
sendEvent
getUpdate
thisMovie

These are included in my page at the top and are not modified.

Again, everything works fine in FireFox, so I don't understand what is wrong here.
Thanks for any tips.
Paul

for the javascript api to work in ie it seems the <object code is also needed - even you have both id and name in your <embed
easiest is to use the swfobject method of embedding - it makes both the <object and <embed correctly...

I tried the swfobject method... but then it won't even work in FireFox. I did see somewhere mentioned about a FF fix, but only a mention... not an actual fix.

Sorry, not trying to be obstinate... I did see mention of using the swfobject.js and tried it, but again... it wouldn't work at all then, something about theMovie(swf) not being defined?

swfobject works fine in firefox - something else must be the problem!
theMovie(swf) not being defined? - often means the name/id/javascriptid are set wrong...

Hi there. I have a simillar problem with the javascript api in IE. Andersen, could you please tell me how my <object>-tag should look like? I would really appreciate any help. Thanks in advance.

Here is the code to my <embed>-tag:
<embed id="jstest" allowscriptaccess="always" src="extra/flash/mediaplayer.swf" width="320" height="240"
type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"
flashvars="file=somefile.swf&displaywidth=320&displayheight=240&allowfullscreen=true&allowscriptaccess=always &javascriptid=jstest&repeat=list&enablejs=true" />

@lodborg

use the swfobject if at all possible - it makes the correct object/embed code for you, much easier to handle!
and prevents the IE "click to activate" annoyance...

the full object/embed code can look like this:

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8"
width="320" height="220"
id="theMediaPlayer">
<param name=movie value="mediaplayer.swf">
<param name=quality value="high">
<param name=bgcolor value="#FFFFFF">
<param name=allowFullScreen value="true">
<param name=swLiveConnect value="true">
<param name=allowScriptAccess value="always">
<param name="FlashVars" value="file=afraid.flv&width=320&height=220&displayheight=200&autostart=true&usefullscreen=true&backcolor=0xFFFFFF&javascriptid=theMediaPlayer">

<embed type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer"
width="320" height="220" bgcolor="#FFFFFF"
name="theMediaPlayer"
src="mediaplayer.swf"
flashvars="file=afraid.flv&width=320&height=220&displayheight=200&autostart=true&usefullscreen=true&backcolor=0xFFFFFF&javascriptid=theMediaPlayer">
</embed>
</object>

Is there a way to get swfobject.js to include the pluginspage option with the embed code?

SWFObject checks for the minimum Flash version that you specify in the JavaScript code for embedding the player. Your HTML element provides the message and link if the user needs to upgrade. SWFObject also can use expressinstall. See the SWFObject site for the details of the implementation.

I too am getting this error in IE. Just like the OP said, everything works fine in Firefox, but IE is a no go. I'm using the SWFObject method to embed the flash object, but I still get the error. I'm not sure what else is needed...

Thanks in advance!

@Nathan,

Post your complete player code or even better, a link to your test page so someone can help you further.

I was having the same issues.

It turned out to be a naming problem. I had my <div> and swfobject ids set to the same value. Once I changed that, the problem went away (in IE7 at least...)

I have the same issue

I found out that it has something to do with my flash being in a form
If I take it out off the form it works fine, but that's no solution for me ...

@Jos - Have you seen this article? There's a problem accessing DOM elements inside a html form element, but there's also a workaround... http://www.psyked.co.uk/adobe/flash/flashjavascript-problems-in-a-net-content-managed-website.htm

Thanx a lots. Just like Kellan, it turned out to be naming problem only. I banged my head yesterday whole day. Thanx god I got the fix now.

If you have multiple instance of SWFObject on the same page and create the object with SWFObject, make sure the 2nd parameter you are giving it is unique. SWFObject assign the object ID to whatever is the second parameter.

For example:

<script type='text/javascript'>
  var s1 = new SWFObject('/embed/player.swf','OBJECT_ID','470','320','9','#ffffff');
  s1.addParam('allowfullscreen','true');
  s1.addParam('allowscriptaccess','always');
  s1.addParam('wmode','opaque');
  s1.addParam('flashvars','file=/upload/flash.flv');
  s1.write('preview');
</script>

Pay attention to

OBJECT_ID

The code above will result into
<embed type="application/x-shockwave-flash" src="/embed/player.swf" style="" id="OBJECT_ID" name="player" bgcolor="#ffffff" quality="high" allowfullscreen="true" allowscriptaccess="always" wmode="opaque" flashvars="file=/upload/flash.flv" height="320" width="470">

Hope that helps.

@Grandma Vanessa - re: problem with big fish - (hmm, can i call you "Old Nessie" ? - sorry, i just could not resist the pun)

maybe you just need to update the flash browser plugin in your web browser -

please note that IE and the others doesnt use the same - so check in each - and note that sometimes a deinstall is needed for the update to function properly...

adobe flash versiontest - http://www.adobe.com/products/flash/about/
adobe flash deinstall - http://kb.adobe.com/go/tn_14157
adobe flash install - http://www.adobe.com/go/getflashplayer

<div name=step_1>STEP 1</div>

if you write:
step_1=getElementById('step_1');
ie return выщевказаний error:

but if you write:
step1=getElementById('step_1');
all OK

problem: _ (upper_space) OR same object-name-id

I have the same problem. Everything work fine in FireFox 3 but when running in ie8, I get that error. "player.sendEvent" is not found. Can someone help me ?

 
@Tùng Đỗ,

If you post a link to your Test Page, someone may be able to help you.

       Our mind-reading device is broken!     :D

Thanks anderson for you valuable help

hello,

It help me to come out with the ie problem.

Thanks

Read these two documents from Adobe.
http://kb2.adobe.com/cps/415/tn_4150.html
http://kb2.adobe.com/cps/127/tn_12701.html

Basically, Firefox recognizes the swf using "name" in embed tag and IE use "id" in object tag.

The code should be like following if you want to communicate the SWF using Javascript.

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8"
width="320" height="220"
<strong>id="theMediaPlayer"</strong>>
<param name=movie value="mediaplayer.swf">
<param name=quality value="high">
<param name=bgcolor value="#FFFFFF">
<param name=allowFullScreen value="true">
<param name=swLiveConnect value="true">
<param name=allowScriptAccess value="always">
<param name="FlashVars" value="file=afraid.flv&width=320&height=220&displayheight=200&autostart=true&usefullscreen=true&backcolor=0xFFFFFF&javascriptid=theMediaPlayer">

<embed type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer"
width="320" height="220" bgcolor="#FFFFFF"
<strong>name="theMediaPlayer"</strong>
src="mediaplayer.swf"
flashvars="file=afraid.flv&width=320&height=220&displayheight=200&autostart=true&usefullscreen=true&backcolor=0xFFFFFF&javascriptid=theMediaPlayer">
</embed>
</object>

You can access the function in swf using JavaScript:
IE:
window["theMediaPlayer"].functionInsideSWF();

FireFox:
document["theMediaPlayer"].functionInsideSWF();

(note: functionInsideSWF() is the ExternalInterface callback function inside the SWF.)

If you want your page works for both browsers, try using browser detection script listed in Adobe livedoc.
Javascript:

function thisMovie(movieName) {
         if (navigator.appName.indexOf("Microsoft") != -1) {
             return window[movieName];
         } else {
             return document[movieName];
         }
     }

function sendToActionScript(value) {
         thisMovie(""theMediaPlayer"").sendToActionScript(value);
     }

 
The Adobe documents that you referenced are very old.

Currently Adobe recommends that you use swfobject v2.2 to embed Flash content.

Hi i am gettin this error in IE

Message: Object doesn't support this property or method
Line: 13
Char: 3
Code: 0
test.js

and my test.js

var ajaxpagefetcher={
loadingmessage: "Loading Page, please wait...",
exfilesadded: "",

connect:function(containerid, pageurl, bustcache, jsfiles, cssfiles){
var page_request = false
var bustcacheparameter=""
if (window.XMLHttpRequest) // if Mozilla, IE7, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE6 or below
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
}
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
var ajaxfriendlyurl=pageurl.replace(/^http:\/\/[^\/]+\//i, "http://"+window.location.hostname+"/")
page_request.onreadystatechange=function(){ajaxpagefetcher.loadpage(page_request, containerid, pageurl, jsfiles, cssfiles)}
if (bustcache) //if bust caching of external page
bustcacheparameter=(ajaxfriendlyurl.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
document.getElementById(containerid).innerHTML=ajaxpagefetcher.loadingmessage //Display "fetching page message"
page_request.open('GET', ajaxfriendlyurl+bustcacheparameter, true)
page_request.send(null)
},

and i m gettin error on
page_request = new XMLHttpRequest() line

pls help me thanx in advance

Take the code from RAY. It is exactly what you need to fix your issue.

Kellan and Wedix, thank you.
After a full day trying to solve a problem where IE would not trigger function calls from links to the player (LOAD playlist etc).. I am filled with happiness and joy-joy to come across your answers!
I need to shout it from the rooftops....
DO NOT NAME YOUR DIV ID and SWFOBJECT ID THE SAME!!!!
Bill won't like it.

please help out from this issue. Thanks in Advance!!..

Line 92
char 1 i am getting an error on page when i try clicking on word "Veikla" at http://www.zalgiriai.taurage.lm.lt/

With firefox it works perfectly,with IE i cant even open "Veikla" link..

script is like

<p class="meniu_pavad"><span style='font-size:9.0pt;color:#006600' onClick="if( ++click >=1 ) {click=0; document.getElementById('xxx').style.display='';}"><span style="cursor:pointer">      
       
      <img src="img/kvadratelis.JPG" id="_x0000_i1028" class="kvadrat">Veikla</span></span></p>
     
      <div id="xxx" style="display: none;">
     
      <p class=verdenus8><img class="kvadrat" id="_x0000_i1031" src="img/kvadratelis.JPG"><a href="Veikla/Nuostatai.htm" target=I1>Nuostatai</a></p>
      <p class=verdenus8><img class="kvadrat" id="_x0000_i1032" src="img/kvadratelis.JPG"><a href="Veikla/Planavimo%20dokumentai.htm" target=I1>Planavimo dokumentai</a></p>
           <p class=verdenus8><img class="kvadrat" id="_x0000_i1033" src="img/kvadratelis.JPG"><a href="Veikla/Veiklos%20sritys.htm" target=I1>Veiklos sritys</a></p>
      <p class=verdenus8><img class="kvadrat" id="_x0000_i1034" src="img/kvadratelis.JPG"><a href="darbo%20uzmokestis.htm" target=I1>Darbo užmokestis</a></p>
      <p class=verdenus8><img class="kvadrat" id="_x0000_i1035" src="img/kvadratelis.JPG"><a href="Veikla/Viesieji%20pirkimai.htm" target=I1>Viešieji pirkimai</a></p>
      <p class=verdenus8><img class="kvadrat" id="_x0000_i1036" src="img/kvadratelis.JPG"><a href="Veikla/Biudzeto%20suvestine.htm" target=I1>Biudžeto suvestinė</a></p>
      <p class=verdenus8><img class="kvadrat" id="_x0000_i1037" src="img/kvadratelis.JPG"><a href="Veikla/Paslaugos.htm" target=I1>Paslaugos</a></p>
      <p class=verdenus8><img class="kvadrat" id="_x0000_i1038" src="img/kvadratelis.JPG"><a href="Veikla/Nuorodos.htm" target=I1>Nuorodos</a></p>
     
      </div>

found error by my self,it didnt liked this if( ++click >=1 ) {click=0; and also removed } at end..works perfectly now

Hi people I´m getting the same problem the code from SWFObject works perfect on firefox but shows nothing on IE6,7n´8... mm.
I´m trying to get a 0 errors on w3c and they won´t take any embed or params... so??? if I use SWFObject it works only in one explorer and if I use RAY´s code I get like 10 errors on w3c WHAT´S THE DEAL?? I don´t get it, my poor brain is melting now....
Any clue how to make both happy?? please!!
By the way my code is:

<div id="flashcontent" align="center">
<script type="text/javascript">
var so = new SWFObject("intro.swf", "intro", "780", "200", "10.0.45.2");
so.addParam("quality", "hight");
so.write("flashcontent");
</script>
  </div>

//before my js code is the same with NO modifications hat I have downloaded from SWFObject´s site
"js/swfobject.js"

OMG!!! I DID IT , I DIT IT!!! IT WORKS PERFECTLY ON:
FIREFOX 5, IE 6, IE 7, IE 8, OPERA, AND CHROME!!!
I´M SO HAPPY!!! U HAVE NO IDEA!!!!

this is the correction they didn´t supported the full name of the flash version wich was: "10.0.45.2" // SO I´VE CHANGED FOR "10"
AND WORKED!!!

FULL CODE PERFECT (HUMBLE OPINION)

  <div id="flashcontent" align="center">
<script type="text/javascript">
var so = new SWFObject("intro.swf", "intro", "780", "200", "10");
so.addParam("quality", "hight");
so.write("flashcontent");
</script>
  </div>

and the js wich can be downloaded from:
http://blog.deconcept.com/swfobject/swfobject.js

GOOD LUCK TO EVERYONE!!

I had the same issue as the original poster and the SWFObject loader finally ended up being the solution.

function xyz()
{
document.getElmentById("inbox1").value="inbox.php";
}
in above function error is Object doesn’t support this property or method at character position of docoment...........please tell any sol.........

Such a script I have works well.

I also had this problem but apparently it was due to some sandbox issue. I was running the htm page from my local hard drive and it always trigger that same error: "Object doesn't support this property or method".

Once I uploaded it to a Web Server it worked fine. I also used swfobject.

I faced the same issue.

I had my <div> and swfobject ids set to the same value. Once I changed that, the problem went away
in IE8

hi
I am not using a swfobject but trying to get remote desktop connection in asp.net 3.5. I have used javascript function to get remote connection, by code is :-

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
    <style type="text/css">
        #form1
        {
            height: 516px;
        }
        #Client1
        {
            height: 283px;
            width: 986px;
        }
    </style>
    <script type="text/javascript" language ="javascript" >
   
    function connect1()
    {
        var e1 = document.getElementById('Client1');
        var e2 = document.getElementById('Text1');
        e1.Connect(e2.value,"User1","");
            
    }
   
   
    </script>
</head>
<body>
    <form id="form1" runat="server">
  
    <input id="Button1" type="button" value="button" onclick="connect1()" />   
    <input id="Button2" type="button" value="button" />     
    <input id="Text1" type="text" />
    <object id = "Client1"  classid ="CLSID:32be5ed2-5c86-480f-a914-0ff8885a1b3f" > </object>
 
</form>
    </body>
</html>

My problem is I am also getting this 'Object doesn't support this property or method' error when i hosted my app on remote server.

Please suggest sumdng
Thanks in advance!!

where is the relevance to the JWPlayer?