History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: LPP-5482
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: P0 P0
Assignee: Max Carlson
Reporter: Lorien Henry-Wilkins
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
OpenLaszlo

Issue running swf in wmode "window" when using html tag

Created: 27/Feb/08 02:59 PM   Updated: 02/Mar/08 02:54 PM
Component/s: Browser Integration
Affects Version/s: Freya, RingDing (4.1)
Fix Version/s: RingDing (4.1), Mars

Time Tracking:
Not Specified

Severity: Minor
Fixed in Change#: 8,144
Runtime: N/A
Fix in hand: False


 Description  « Hide
When using the HTML tag in IE I need to run the swf with wmode window because in transparent and opaque the swf doesn't get mouse events. For example, when mousing over a clickable item in the swf the cursor won't change to a hand, and you have to doubleclick to select. This is ok, because window mode works fine with the html tag, the only problem is that if you click on the iframe, and then click back in the swf the iframe goes behind the swf, so I have to put in additional logic for keeping the iframe in front of the swf when the swf takes focus. To take care of this, I simply attach an event handler on the onfocus event of the swf, and in this event handler ensure the iframe is visible by doing:

   if(iframe) {
       if(iframe.style.display == 'block') {
           iframe.style.display = 'none';
           iframe.style.display = 'block'; }
   }


 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Amy Muntz - 28/Feb/08 11:43 AM
Max - can you please checkin a fix as soon as possible for this? pagan-deities is the branch. Mars is the next release of the branch, fyi.

Max Carlson - 29/Feb/08 11:48 AM
To reproduce, modify lps/components/extensions/test/html-swf.jsp to set wmode: 'window' and load in IE. Once you have the iframe visible (I have to drag the window first to get it to show up) click inthe iframe and then click on the swf. You will see the iframe disappear.

Max Carlson - 29/Feb/08 06:36 PM
Author: max
Date: 2008-02-29 18:28:06 -0800 (Fri, 29 Feb 2008)
New Revision: 8144

Modified:
   openlaszlo/trunk/lps/includes/source/embednew.js
   openlaszlo/trunk/lps/includes/source/iframemanager.js
Log:
Change 20080229-maxcarlson-Y by maxcarlson@Roboto on 2008-02-29 11:45:38 PST
    in /Users/maxcarlson/openlaszlo/trunk-clean
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Fix html tag for wmode window in IE

New Features:

Bugs Fixed: LPP-5482 - Issue running swf in wmode "window" when using html tag

Technical Reviewer: promanik
QA Reviewer: lhenrywilkins@laszlosystems.com
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details: embednew.js - Add Lz[appname]._getSWFDiv() API for use by iframemanager.

iframemanager.js - Track __topiframe. Call __refresh() when Flash gets the focus, to ensure the iframe remains visible.


Tests: See LPP-5482.



Modified: openlaszlo/trunk/lps/includes/source/embednew.js
===================================================================
--- openlaszlo/trunk/lps/includes/source/embednew.js 2008-02-29 23:44:56 UTC (rev 8143)
+++ openlaszlo/trunk/lps/includes/source/embednew.js 2008-03-01 02:28:06 UTC (rev 8144)
@@ -2,7 +2,7 @@
   * @topic Browser
   * @subtopic Integration
   * @access public
- * @copyright Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved.
+ * @copyright Copyright 2001-2008 Laszlo Systems, Inc. All Rights Reserved.
   * Use is subject to license terms.
   */
   
@@ -113,6 +113,7 @@
             ,_ready: Lz._ready
             // List of functions to call when the app is loaded
             ,_onload: []
+ ,_getSWFDiv: Lz._getSWFDiv
             ,loaded: false
             ,_sendMouseWheel: Lz._sendMouseWheel
             ,_setCanvasAttributeDequeue: Lz._setCanvasAttributeDequeue
@@ -595,6 +596,10 @@
         return root;
     }
     ,/** @access private */
+ _getSWFDiv: function() {
+ return dojo.flash.obj.get();
+ }
+ ,/** @access private */
     _sendMouseWheel: function(d) {
         if (d != null) this.callMethod("LzKeys.__mousewheelEvent(" + d + ")");
     }

Modified: openlaszlo/trunk/lps/includes/source/iframemanager.js
===================================================================
--- openlaszlo/trunk/lps/includes/source/iframemanager.js 2008-02-29 23:44:56 UTC (rev 8143)
+++ openlaszlo/trunk/lps/includes/source/iframemanager.js 2008-03-01 02:28:06 UTC (rev 8144)
@@ -1,5 +1,5 @@
 /* X_LZ_COPYRIGHT_BEGIN ***************************************************
-* Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved. *
+* Copyright 2001-2008 Laszlo Systems, Inc. All Rights Reserved. *
 * Use is subject to license terms. *
 * X_LZ_COPYRIGHT_END ******************************************************/
 Lz.iframemanager = {
@@ -28,11 +28,21 @@
         iframe.__gotload = Lz.iframemanager.__gotload;
         iframe._defaultz = 99900 + Lz.iframemanager.__highestz;
         iframe.style.zIndex = iframe._defaultz;
+
+ Lz.iframemanager.__topiframe = id;
         if (document.getElementById && !(document.all) ) {
             iframe.style.border = '0';
         } else if (document.all) {
+ // IE
             Lz.__setAttr(iframe, 'border', '0');
             Lz.__setAttr(iframe, 'allowtransparency', 'true');
+
+ var metadata = Lz[iframe.owner]
+ if (metadata.runtime == 'swf') {
+ // register for onfocus event for swf movies - see LPP-5482
+ var div = metadata._getSWFDiv();
+ div.onfocus = Lz.iframemanager.__refresh;
+ }
         }
         iframe.style.position = 'absolute';
         return id + '';
@@ -74,7 +84,6 @@
         var iframe = Lz.iframemanager.getFrame(id);
         if (! iframe) return;
         iframe.style.display = v ? 'block' : 'none';
- this._visible = v;
         return true;
     }
     ,bringToFront: function(id) {
@@ -83,6 +92,7 @@
         var iframe = Lz.iframemanager.getFrame(id);
         if (! iframe) return;
         iframe.style.zIndex = 100000 + Lz.iframemanager.__highestz;
+ Lz.iframemanager.__topiframe = id;
         return true;
     }
     ,sendToBack: function(id) {
@@ -110,4 +120,14 @@
             Lz[iframe.owner].callMethod('Lz.iframemanager.__gotload(\'' + id + '\')');
         }
     }
+ ,__refresh: function() {
+ // called in IE for onfocus event in swf - see LPP-5482
+ if (Lz.iframemanager.__topiframe) {
+ var iframe = Lz.iframemanager.getFrame(Lz.iframemanager.__topiframe);
+ if (iframe.style.display == 'block') {
+ iframe.style.display = 'none';
+ iframe.style.display = 'block';
+ }
+ }
+ }
 }


_______________________________________________
Laszlo-checkins mailing list
Laszlo-checkins@openlaszlo.org
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins