Flash IE8 Javascript Error

0 comments

Flash generates a bunch of js code for communication with javascript. This can easily break in old versions of IE.

 

Here is some of the Flash generated code:

 

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

 

If there is an error in these function, due to "instance" being null, this can be fixed by altering the "object" tag to include name and id.

 

For example, this code has the error:

 

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" height="294" width="440"> <param name="flashvars" value="file=http://www.bp2go.co.nz/attachments/docs/nav-and-intro-tutorial.flv" /> <param name="allowFullScreen" value="true" /><param name="quality" value="high" /> <param name="src" value="http://www.bp2go.co.nz/swf/player.swf" /> <embed height="294" src="http://www.bp2go.co.nz/swf/player.swf" type="application/x-shockwave-flash" width="440" flashvars="file=/attachments/docs/nav-and-intro-tutorial.flv" allowfullscreen="true" /> </object>

 

This code works properly:

 

<object id="dummy" name="dummy" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" height="294" width="440">

<param name="flashvars" value="file=http://www.bp2go.co.nz/attachments/docs/nav-and-intro-tutorial.flv" /> <param name="allowFullScreen" value="true" /><param name="quality" value="high" /> <param name="src" value="http://www.bp2go.co.nz/swf/player.swf" /> <embed height="294" src="http://www.bp2go.co.nz/swf/player.swf" type="application/x-shockwave-flash" width="440" flashvars="file=/attachments/docs/nav-and-intro-tutorial.flv" allowfullscreen="true" /> </object>

 


Comments


Leave a Comment