Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flash IE8 Javascript Error #5

Open
keshidong opened this issue Sep 1, 2016 · 0 comments
Open

Flash IE8 Javascript Error #5

keshidong opened this issue Sep 1, 2016 · 0 comments

Comments

@keshidong
Copy link
Owner

keshidong commented Sep 1, 2016

Flash IE8 Javascript Error

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant