Hi,

I'm using the example here:
http://pipwerks.com/lab/swfobject/load-onclick/2.0/index.html
to dynamically reload a SWF with different params as the user clicks
various links.

In FF3 / Safari 3 the SWF loads fine. In IE7, the container div
expands as if something had been loaded into it, but nothing is
actually displayed. Although if I right-click the area that should be
displaying a SWF, I get the standard Flash right-click menu, not IE's.
This happens regardless of whether it's the first time any Flash has
been loaded into the div or not. There are no other Flash areas on the
page.

Here's my HTML:
<div id="flashModal" style="display:none;">
        <div id="flashContent">
                You need Flash enabled to view this content.
        </div>
</div>

and here's the JS I'm using:

function isObject(targetID){
   var isFound = false;
   var el = document.getElementById(targetID);
   if(el && (el.nodeName === "OBJECT" || el.nodeName === "EMBED")){
      isFound = true;
   }
   return isFound;
}

function replaceSwfWithEmptyDiv(targetID){
   var el = document.getElementById(targetID);
   if(el){
      var div = document.createElement("div");
      el.parentNode.insertBefore(div, el);
      swfobject.removeSWF(targetID);
      div.setAttribute("id", targetID);
   }
}


function loadGreetingSWF(greetingID){

        var targetID = "flashContent";

        if(isObject(targetID)){
                replaceSwfWithEmptyDiv(targetID);
        }

        if (swfobject.hasFlashPlayerVersion("9")) {

                var params = {
                        play:                           true,
                        loop:                           true,
                        menu:                           true,
                        quality:                        'high',
                        allowScriptAccess:      'sameDomain',
                        pluginspage:            
'http://www.macromedia.com/go/getflashplayer',
                        devicefont:                     false,
                        salign:                         '',
                        flashvars:                      
'greetingID='+greetingID,
                        wmode:                          "transparent"
                }

                var attributes = {
                        data:           "cg_open_greeting.swf",
                        name:           'flashContent',
                        align:          'middle',
                        width:          "940",
                        height:         "827"
                };

                var obj = swfobject.createSWF(attributes, params, targetID);

   }

}

Any ideas why I'm getting this behaviour in IE7? It seems to be
loading something that it thinks is Flash, but I'm lost as to why
there's no content in it.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"SWFObject" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/swfobject?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to