0

I want to embed SWF object to my HTMl file dynamically. So I'm using embedSWF function. It works in chrome browser but it doesn't work in IE. (Now I'm testing on IE11 but it must work on IE8)

Here is my javascript:

<script type="text/javascript"> 
swfobject.embedSWF("test.swf", "myContent", "300", "120", "9", "expressInstall.swf", "", "", "" ,console.log("flash object is created"));   
</script>

here is my html:

<div id="myContent"></div>

How can I fix this issue?

1 Answer 1

1

You are using console.log() as callback function, which is wrong. While I don't believe it really matters for swfobject, you can try:

<script type="text/javascript"> 
swfobject.embedSWF("test.swf", "myContent", "300", "120", "9", "expressInstall.swf", "", "", "" , swfCallback);

function swfCallback( event ) {
    // Will append true/false to your log.
    console.log("flash object is created:", event.success );
}   
</script>

To check if there could be issues with IE's Flash Player itself, you could try to log it's version beforehand:

console.log( swfobject.getFlashPlayerVersion() );
Sign up to request clarification or add additional context in comments.

3 Comments

I changed code as you suggested. This was logged: flash object is created: false; {major: 0, minor: 0, release: 0}
probably problem is flash player version. I don't know why is it 0, I checked in IE options and "shockwave flash object" is enabled
Since IE's player is different from Chrome's or whatever I'd suggest explicitly reinstalling it: go to get.adobe.com/flashplayer/otherversions, Choose your OS and "Flash player for Internet Explorer" as a second option.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.