Jump to content

Why would there be an error in IE and not in FF?


Recommended Posts

I'm using this code:

 

<object type="application/x-shockwave-flash" data="http://infectionist.com/misc/player.swf" width="290" height="24" id="audioplayer1">
<param name="movie" value="http://infectionist.com/misc/player.swf" />
<param name="FlashVars" value="playerID=1&bg=0xf8f8f8&leftbg=0xeeeeee&lefticon=0x666666&rightbg=0xcccccc&rightbghover=0x999999&righticon=0x666666&righticonhover=0xffffff&text=0x666666&slider=0x666666&track=0xFFFFFF&border=0x666666&loader=0x9FFFB8&soundFile=http%3A%2F%2Finfectionist.com%2Fmusic%2FPirates.mp3" />
<param name="quality" value="high" />
<param name="menu" value="false" />
<param name="bgcolor" value="#FFFFFF" />
</object>

 

And this flash mp3 player:

 

http://infectionist.com/misc/player.swf

 

And for whatever stupid reason, it's generating an error in IE and not in FF; the error:

 

Line: 1

Char: 1

Error: Object Expected

Code: 0

URL: http://infectionist.com/misc/player.php

 

Why oh WHY would it do this?  I hate errors, even more I hate unexplainable errors.  There is NO reason why this should give an error.

 

I noticed that if I embed the flash file from another server it works peachy in IE.  The site I got it from was here:

 

http://bethblog.com/index.php/2008/09/16/the-gray-fox-rap/

 

If I embed the swf (change the object data attribute and the movie param value to point to the file on Bethesda.com's server), it works just fine; no error in IE or FF.  As soon as I change it to point to my OWN server though, that's when the errors start.

 

I've tried absolute paths, URLs, and relative paths...nothing seems to work.

 

Please help, like I said, I hate errors.

Flash embedding methods are different depending on the browser you are using. As such, I recommend (and use) swfobject - it's javascript code that embeds the flash file into the page, and is cross-browser compatible. It also allows for alternate content, and setting of parameters. Version 2.0 is hosted on google code, and has quite comprehensive documentation.

But the code that I copied directly from Bethesda works fine in IE, and when I call the swf player from Bethesda it works, it's only when Icall from my own server that it gives an error, and I was messing around with this about a month ago and I don't remember there being an error.

I'm not really trying to solve the problem to make it work, rather I just want to know why it would work as it is, giving an error only in IE and only when the player is called from my server.  I don't really NEED this to work for anything, at least not yet.  Like I said, I just want to know why it doesn't work.

I think it can be an active content wich can be a pain - DW fixes this automatically by adding this Scripting to the code - try that. - I have bolded the script for editing

 

<script src="AC_RunActiveContent.js" type="text/javascript"></script>
</head>

<body>
<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0','width','[b]xxxxx[/b]','height','[b]xxxxx[/b]','src','[b]xxxxx[/b]','quality','high','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','[b]xxxxx[/b]' ); //end AC code
</script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="105" height="21">
  <param name="movie" value="[b]xxxxxx[/b]" />
  <param name="quality" value="high" />
  <embed src="[b]xxxxxx[/b]" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="[b]xxxxxx[/b]" height="[b]xxxxxx[/b]"></embed>
</object></noscript>

 

 

//v1.0
//Copyright 2006 Adobe Systems, Inc. All rights reserved.
function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}

function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
  var str = '<object ';
  for (var i in objAttrs)
    str += i + '="' + objAttrs[i] + '" ';
  str += '>';
  for (var i in params)
    str += '<param name="' + i + '" value="' + params[i] + '" /> ';
  str += '<embed ';
  for (var i in embedAttrs)
    str += i + '="' + embedAttrs[i] + '" ';
  str += ' ></embed></object>';

  document.write(str);
}

function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_SW_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblClick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "id":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}

So simply putting the javascript:

 

<script type="text/javascript" src="http://bethblog.com/wp-content/plugins/flv-embed/swfobject.js"></script>

 

In the page where I have this player would make it work?  Because I copied the rest of the code exactly.  I'll try it.

 

Edit: Nope, I uploaded swfobject.js straight from bethesda to my server, put this code in the file:

 

[coe]<script type="text/javascript" src="/misc/swfobject.js"></script>[/code]

 

Making my overall code this:

 

<script type="text/javascript" src="/misc/swfobject.js"></script>
<object type="application/x-shockwave-flash" data="http://infectionist.com/misc/player.swf" width="290" height="24" id="audioplayer1">
<param name="movie" value="http://infectionist.com/misc/player.swf">
<param name="FlashVars" value="playerID=1&bg=0xf8f8f8&leftbg=0xeeeeee&lefticon=0x666666&rightbg=0xcccccc&rightbghover=0x999999&righticon=0x666666&righticonhover=0xffffff&text=0x666666&slider=0x666666&track=0xFFFFFF&border=0x666666&loader=0x9FFFB8&soundFile=http://infectionist.com/music/Pirates.mp3">
<param name="quality" value="high">
<param name="menu" value="false">
<param name="bgcolor" value="#FFFFFF">
</object>

 

And it still gives an error.

 

Here is the page:

 

http://infectionist.com/misc/player.php

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.