HaLo2FrEeEk Posted February 20, 2009 Share Posted February 20, 2009 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. Quote Link to comment Share on other sites More sharing options...
Goafer Posted February 21, 2009 Share Posted February 21, 2009 As it's a link do you not need to have the url as "href=" rather than "value=" ? Quote Link to comment Share on other sites More sharing options...
haku Posted February 21, 2009 Share Posted February 21, 2009 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. Quote Link to comment Share on other sites More sharing options...
HaLo2FrEeEk Posted February 22, 2009 Author Share Posted February 22, 2009 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. Quote Link to comment Share on other sites More sharing options...
haku Posted February 23, 2009 Share Posted February 23, 2009 I gave you a solution. If you don't want to use it, then don't. But it will solve your problems. Up to you. Quote Link to comment Share on other sites More sharing options...
HaLo2FrEeEk Posted February 23, 2009 Author Share Posted February 23, 2009 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. Quote Link to comment Share on other sites More sharing options...
haku Posted February 24, 2009 Share Posted February 24, 2009 Because the code you are using isn't cross-browser compatible. Quote Link to comment Share on other sites More sharing options...
baccarak Posted February 25, 2009 Share Posted February 25, 2009 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; } Quote Link to comment Share on other sites More sharing options...
haku Posted February 25, 2009 Share Posted February 25, 2009 Dreamweaver's code works, but it uses noscript tags. That's where swfobject is better - it doesn't use noscript tags, and still allows for alternate content. Quote Link to comment Share on other sites More sharing options...
HaLo2FrEeEk Posted February 26, 2009 Author Share Posted February 26, 2009 Haku, if the code isn't cross browser compatible then WHY does it work in both IE and FF when I use it from Bethesda's site? It's only when I use it from my site that it doesn't work. That doesn't make sense. Quote Link to comment Share on other sites More sharing options...
haku Posted February 27, 2009 Share Posted February 27, 2009 Because they are using swfobject! I didn't even look at their site from your original post, but I just looked at it now, and the link is right in their code (you can see it with view source -> ctrl + F -> 'swfobject'). Quote Link to comment Share on other sites More sharing options...
HaLo2FrEeEk Posted March 1, 2009 Author Share Posted March 1, 2009 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 Quote Link to comment Share on other sites More sharing options...
haku Posted March 1, 2009 Share Posted March 1, 2009 swfobject documentation You'll find everything you need right there mate. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.