thuansaritasa / swfobject

Automatically exported from code.google.com/p/swfobject
0 stars 0 forks source link

parObj format resulting in outputting incorrect parameter entities #296

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. call swfobject.embedSWF as so:
var flashvars = {};
var params = { wmode: "opaque" };
var attributes = {};
swfobject.embedSWF("/swf/myswf.swf", "homeBanner", "996", "314", "9.0.0",
flashvars, params, attributes);

What is the expected output? What do you see instead?
expected:
<param name="wmode" value="opaque" />
instead:
<param name="params" value="wmode=opaque" />

What version of the product are you using? On what operating system?
swfobject 2.1, mac osx leopard, winxp sp3, ff2+, safari3, ie6-7

Please provide any additional information below.
I was using swfobject thusly:
var flashvars = {};
var params = { wmode: "opaque" };
var attributes = {};
swfobject.embedSWF("/swf/filename.swf", "homeBanner", "996", "314",
"9.0.0", flashvars, params, attributes);

this block in swfobject was using 'params' from my call rather than 'wmode'
for the name of the parameter:

function createObjParam(el, pName, pValue) {
        var p = createElement("param");
        p.setAttribute("name", pName);  
        p.setAttribute("value", pValue);
        el.appendChild(p);
    }

resulting in this markup which didn't have the desired result:
<param name="params" value="wmode=opaque" />

I kluged around it like so:
function createObjParam(el, pName, pValue) {
        var splitIdx = pValue.indexOf('=');
        var locName = pValue.substring(0,splitIdx);
        var locValue = pValue.substring((splitIdx + 1),pValue.length);
        var p = createElement("param");
        //p.setAttribute("name", pName);    
        //p.setAttribute("value", pValue);
        p.setAttribute("name", locName);    
        p.setAttribute("value", locValue);
        el.appendChild(p);
    }

That resulted in parameters mapping name/value:key/value as so:
<param name="wmode" value="opaque" />

I also kluged similarly with the IE specific parameter building starting on
line 369 (for (var j in parObj) {) of the source that came in the zip file.

I didn't track down where in the object the data I really wanted was, but
it's likely that's what needs to be done to fix this in all the instances
where param entities are created.  Probably just selecting the wrong
properties of the object.

Original issue reported on code.google.com by tac...@gmail.com on 8 Apr 2009 at 1:09

GoogleCodeExporter commented 9 years ago
This is an authoring mistake, you missed out on the parameter for the express 
install
SWF path (in between Player version and flashvars Object)

Original comment by bobbyvandersluis on 8 Apr 2009 at 3:15