Author: johnh
Date: Fri Mar  4 03:20:07 2011
New Revision: 1076930

URL: http://svn.apache.org/viewvc?rev=1076930&view=rev
Log:
Flash transport, now working on IE!


Modified:
    shindig/trunk/features/src/main/javascript/features/rpc/flash.transport.js

Modified: 
shindig/trunk/features/src/main/javascript/features/rpc/flash.transport.js
URL: 
http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/rpc/flash.transport.js?rev=1076930&r1=1076929&r2=1076930&view=diff
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/rpc/flash.transport.js 
(original)
+++ shindig/trunk/features/src/main/javascript/features/rpc/flash.transport.js 
Fri Mar  4 03:20:07 2011
@@ -32,6 +32,7 @@ gadgets.rpctx = gadgets.rpctx || {};
 if (!gadgets.rpctx.flash) {  // make lib resilient to double-inclusion
 
   gadgets.rpctx.flash = function() {
+    var swfId = "___xpcswf";
     var swfUrl = null;
     var usingFlash = false;
     var process = null;
@@ -56,14 +57,27 @@ if (!gadgets.rpctx.flash) {  // make lib
 
     function relayLoader() {
       if (relayHandle === null && document.body && swfUrl) {
-        relayHandle = document.createElement('embed');
-        relayHandle.setAttribute("allowScriptAccess", "always");
-        relayHandle.src = swfUrl + '?origin=' + myLoc;
-        relayHandle.style.top = -1;
-        relayHandle.style.left = -1;
-        relayHandle.style.height = 1;
-        relayHandle.style.width = 1;
-        document.body.appendChild(relayHandle);
+        var theSwf = swfUrl + '?origin=' + myLoc;
+
+        var containerDiv = document.createElement('div');
+        containerDiv.style.height = '1px';
+        containerDiv.style.width = '1px';
+        var html = '<object height="1" width="1" id="' + swfId +
+            '" type="application/x-shockwave-flash">' +
+            '<param name="allowScriptAccess" value="always"></param>' +
+            '<param name="movie" value="' + theSwf + '"></param>' +
+            '</object>';
+
+        var embedElem = document.createElement('embed');
+        embedElem.setAttribute("allowScriptAccess", "always");
+        embedElem.setAttribute("src", theSwf);
+        embedElem.setAttribute("height", "1");
+        embedElem.setAttribute("width", "1");
+
+        document.body.appendChild(containerDiv);
+        containerDiv.innerHTML = html;
+
+        relayHandle = containerDiv.firstChild;
       }
       ++setupAttempts;
       if (setupHandle !== null &&


Reply via email to