SitePoint Sponsor

User Tag List

Results 1 to 17 of 17
  1. #1
    runat="server" Golgotha's Avatar
    Join Date
    Nov 2001
    Location
    Colorado
    Posts
    2,085
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation JavaScript error in IE6 for SWFObject v1.5

    Hey Guys,
    I get this error (see link below) for IE6. But it only happens sometimes? If anyone can help that would be great!

    http://www.search-this.com/js-error.gif

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,705
    Mentioned
    101 Post(s)
    Tagged
    4 Thread(s)
    How are you using the code around that flash object?

  3. #3
    runat="server" Golgotha's Avatar
    Join Date
    Nov 2001
    Location
    Colorado
    Posts
    2,085
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    not sure what you mean?

    <script type="text/javascript" src="http://www.search-this.com/podcast/swfobject.js"></script>

  4. #4
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,705
    Mentioned
    101 Post(s)
    Tagged
    4 Thread(s)
    Others have been having this issue too. You may want to look in to SWFFormFix.

    The reason why you're getting the bug is because:

    I found yet another IE bug related to this topic. After a page is cached by IE and reloaded, the SWF is loaded before it's embedded, so any callback functions the the SWF tries to setup when it loads (like the JS->Flash ExternalInterface code) will fail with an error "objectID" is undefined. Then when you try to use the callback function you get Object doesn't support this property or method because the functions didn't get assigned to the Flash object properly.
    The solution is to put this line above your SWF Object code, or object element.

    Code JavaScript:
    window["objectid"] = new Object();

    Replace objectid with the id that you've given your SWF Object.

  5. #5
    runat="server" Golgotha's Avatar
    Join Date
    Nov 2001
    Location
    Colorado
    Posts
    2,085
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmmm, that does sound like the problem...

    unfortunately, I don't get your solution? My code is below, what's your fix?

    Code JavaScript:
    <script type="text/javascript">
    <!--//--><![CDATA[//><!--
    var so = new SWFObject("[url]http://www.search-this.com/podcast/podPlayer.swf[/url]", "webPod", "165", "165", "8", "#ffffff");
    so.addParam("quality", "best");
    so.addParam("wmode", "transparent");
    so.addParam("menu", "false");
    so.addVariable("xmlFile", "[url]http://www.search-this.com/podcast/tunes.xml[/url]");
    so.write("flashcontent");
    //--><!]]>
    </script>

  6. #6
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,705
    Mentioned
    101 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by Golgotha View Post
    hmmm, that does sound like the problem...

    unfortunately, I don't get your solution? My code is below, what's your fix?
    The solution is to put this line above your SWF Object code, or object element.

    Code JavaScript:
    window["objectid"] = new Object();

    Here is how you would fix your code.

    Code JavaScript:
    window["webPod"] = new Object();
    var so = new SWFObject("[url]http://www.search-this.com/podcast/podPlayer.swf[/url]", "webPod", "165", "165", "8", "#ffffff");
    so.addParam("quality", "best");
    . . .

  7. #7
    runat="server" Golgotha's Avatar
    Join Date
    Nov 2001
    Location
    Colorado
    Posts
    2,085
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Unfortunately that stops it from working in IE7?

  8. #8
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,705
    Mentioned
    101 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by Golgotha View Post
    Unfortunately that stops it from working in IE7?
    I haven't been able to get it to break yet while testing across Firefox, IE6 and IE7 from a remote server.
    How does the following stop working on IE7?

    Code JavaScript:
    <div id="flashcontent"></div>
    <script type="text/javascript" src="swfobject.js"></script>
    <script type="text/javascript">
    <!--//--><![CDATA[//><!--
    window["yesno"] = new Object();
    var so = new SWFObject("yesno.swf", "yesno", "165", "165", "8", "#ffffff");
    so.addParam("quality", "best");
    so.addParam("wmode", "transparent");
    so.addParam("menu", "false");
    so.write("flashcontent");
    //--><!]]>
    </script>

  9. #9
    runat="server" Golgotha's Avatar
    Join Date
    Nov 2001
    Location
    Colorado
    Posts
    2,085
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    "How does the following stop working on IE7?"
    wish I knew pmw75, but I don't? Check out the Random Bits podcast on the right column. Notice when I now click a link (that uses js) it nolonger plays? but it will if I remove this line: window["webPod"] = new Object();

    and it works in Firefox...

    http://www.search-this.com/random-bits/

  10. #10
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,705
    Mentioned
    101 Post(s)
    Tagged
    4 Thread(s)
    IE7 says the error is occurring on this return

    Code JavaScript:
    function __flash__addCallback(instance, name) {
      instance[name] = function () { 
        return eval(instance.CallFunction("<invoke name=\""+name+"\" returntype=\"javascript\">" + __flash__argumentsToXML(arguments,0) + "</invoke>"));
      }
    }

  11. #11
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,705
    Mentioned
    101 Post(s)
    Tagged
    4 Thread(s)
    As your particular application appears to be experiencing trouble with the fix, there are other ways of dealing with it.

    You really should remove that fix if it's causing trouble with playing podcasts.

    You may want to take a look at other flash embedding techniques if you don't want to live with the IE6 troubles.

  12. #12
    SitePoint Member
    Join Date
    Apr 2008
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for the solution of this error, it's useful to me.

  13. #13
    SitePoint Member
    Join Date
    Apr 2008
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by pmw57 View Post
    I haven't been able to get it to break yet while testing across Firefox, IE6 and IE7 from a remote server.
    How does the following stop working on IE7?

    Code JavaScript:
    <div id="flashcontent"></div>
    <script type="text/javascript" src="swfobject.js"></script>
    <script type="text/javascript">
    <!--//--><![CDATA[//><!--
    window["yesno"] = new Object();
    var so = new SWFObject("yesno.swf", "yesno", "165", "165", "8", "#ffffff");
    so.addParam("quality", "best");
    so.addParam("wmode", "transparent");
    so.addParam("menu", "false");
    so.write("flashcontent");
    //--><!]]>
    </script>
    Thanks for pointing out the error. I really wonder how to correct it! Anyone help???

  14. #14
    SitePoint Member
    Join Date
    May 2008
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I also want to know the answer. Anyone know it?

  15. #15
    SitePoint Member
    Join Date
    Jun 2008
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Might use IE conditional comments to only do the window["objectid"] = new Object(); code if in IE6 or less. Like so...
    Code:
    <div id="flashcontent"></div>
    <script type="text/javascript" src="swfobject.js"></script>
    <!--[if lte IE 6]>
    <script type="text/Javascript"><!--//--><![CDATA[//><!--
    window["yesno"] = new Object();
    //--><!]]>
    </script>
    <![endif]-->
    <script type="text/javascript">
    <!--//--><![CDATA[//><!--
    var so = new SWFObject("yesno.swf", "yesno", "165", "165", "8", "#ffffff");
    so.addParam("quality", "best");
    so.addParam("wmode", "transparent");
    so.addParam("menu", "false");
    so.write("flashcontent");
    //--><!]]>
    </script>

  16. #16
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    There is a newer version of swfobject than 1.5.

    Version 2.0

    Maybe it addresses these problems.

  17. #17
    SitePoint Member
    Join Date
    Jun 2008
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    All I can say is forget about IE6 hopefully it will be forgotten.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •