[Laszlo-checkins] r13201 - in openlaszlo/branches/4.2: . WEB-INF/lps/lfc WEB-INF/lps/lfc/kernel/swf9 WEB-INF/lps/server/src/org/openlaszlo/compiler

max@openlaszlo.org max at openlaszlo.org
Fri Mar 6 07:20:49 PST 2009


Author: max
Date: 2009-03-06 07:20:45 -0800 (Fri, 06 Mar 2009)
New Revision: 13201

Modified:
   openlaszlo/branches/4.2/
   openlaszlo/branches/4.2/WEB-INF/lps/lfc/kernel/swf9/LzPreloader.as
   openlaszlo/branches/4.2/WEB-INF/lps/lfc/lzpreloader.as
   openlaszlo/branches/4.2/WEB-INF/lps/server/src/org/openlaszlo/compiler/SWF9Writer.java
Log:
Merged revisions 13200 via svnmerge from 
http://svn.openlaszlo.org/openlaszlo/trunk

.......
  r13200 | max | 2009-03-06 07:17:33 -0800 (Fri, 06 Mar 2009) | 18 lines
  
  Change 20090305-maxcarlson-l by maxcarlson at Bank.local on 2009-03-05 20:10:53 PST
      in /Users/maxcarlson/openlaszlo/trunk-clean
      for http://svn.openlaszlo.org/openlaszlo/trunk
  
  Summary: Fix load progress updates for swf 8 and 9 to not cause 'clicking' in IE
  
  Bugs Fixed: LPP-7737 -  IE "Click Sounds" problem when loading
  
  Technical Reviewer: promanik
  QA Reviewer: mohammad at zeineddin.name
  
  Details: LzPreloader, lzpreloader - Update to use ExternalInterface calls instead of loading URLs.
  
  SWF9Writer - Update to include code from LzPreloader.
  
  Tests: Modified WEB-INF/lps/templates/html-response.xslt#onloadstatus() method to show load progress information, to verify updates are being sent for swf8/9.  Used fiddler proxy under windows with 'simulate modem speed' script to verify there is no more clicking in IE even for slow downloads.
.......



Property changes on: openlaszlo/branches/4.2
___________________________________________________________________
Name: svnmerge-integrated
   - /openlaszlo/branches/4.1:1-10153 /openlaszlo/branches/devildog:1-8432 /openlaszlo/branches/pagan-deities:1-7955,8825,10756-10920,10922-10928,10930-10935,11151,11207,11554 /openlaszlo/branches/paperpie:1-6504,6506-6574,6576-7135,7137-7235 /openlaszlo/branches/wafflecone:1-5746,5818-6068,6070-6205,6207-6213,6216-6265,6267-6368,6370-6431,6433-6450,6497,6509,6661,7097,7872 /openlaszlo/trunk:1-12154,12172-12175,12177-12185,12187-12194,12196,12201,12208,12229,12251-12252,12254-12255,12257-12258,12260,12262-12266,12268-12269,12271-12275,12278-12285,12303,12318-12323,12340-12348,12352,12354-12358,12360-12361,12363,12365-12367,12369-12371,12375-12378,12380-12389,12391,12394-12396,12399-12400,12402-12403,12406-12416,12419-12422,12424-12429,12431-12433,12435,12437-12441,12443,12445,12447,12449-12451,12453-12454,12457-12460,12464,12466-12475,12477-12480,12482-12490,12493-12495,12499-12502,12507-12510,12512,12514-12520,12522,12525-12531,12534-12540,12542,12545,12548-12554,12557-12561,12564,12566-12568,12571,12574-12576,12578,12580,12583-12584,12586-12587,12589,12592-12596,12598-12600,12602-12609,12611-12615,12617,12619-12621,12623,12625,12628-12631,12633-12635,12637,12639,12642,12644,12647-12653,12656,12658,12660,12662-12666,12668-12694,12696,12698-12704,12708-12710,12712-12721,12723-12729,12731-12742,12745-12752,12754-12784,12786-12791,12793-12798,12800-12801,12803,12805-12808,12810-12812,12814,12816-12821,12825-12833,12835-12837,12839-12841,12847,12849-12859,12863-12883,12885-12895,12897-12906,12908-12915,12917-12922,12924-12934,12937-12940,12943-12944,12946-12947,12950-12952,12955-12964,12966-12969,12971,12973-12977,12979-12993,12997-12999,13001-13003,13006-13007,13010-13015,13017-13020,13022-13024,13026-13031,13033,13035-13037,13039-13040,13043,13046-13052,13055-13060,13062-13069,13071-13072,13074,13076-13085,13087-13093,13095-13101,13103-13104,13106,13108-13110,13112,13114-13120,13122,13125-13126,13129,13132-13136,13139-13140,13142,13147,13157-13158,13163,13167,13176,13186,13188,13195
   + /openlaszlo/branches/4.1:1-10153 /openlaszlo/branches/devildog:1-8432 /openlaszlo/branches/pagan-deities:1-7955,8825,10756-10920,10922-10928,10930-10935,11151,11207,11554 /openlaszlo/branches/paperpie:1-6504,6506-6574,6576-7135,7137-7235 /openlaszlo/branches/wafflecone:1-5746,5818-6068,6070-6205,6207-6213,6216-6265,6267-6368,6370-6431,6433-6450,6497,6509,6661,7097,7872 /openlaszlo/trunk:1-12154,12172-12175,12177-12185,12187-12194,12196,12201,12208,12229,12251-12252,12254-12255,12257-12258,12260,12262-12266,12268-12269,12271-12275,12278-12285,12303,12318-12323,12340-12348,12352,12354-12358,12360-12361,12363,12365-12367,12369-12371,12375-12378,12380-12389,12391,12394-12396,12399-12400,12402-12403,12406-12416,12419-12422,12424-12429,12431-12433,12435,12437-12441,12443,12445,12447,12449-12451,12453-12454,12457-12460,12464,12466-12475,12477-12480,12482-12490,12493-12495,12499-12502,12507-12510,12512,12514-12520,12522,12525-12531,12534-12540,12542,12545,12548-12554,12557-12561,12564,12566-12568,12571,12574-12576,12578,12580,12583-12584,12586-12587,12589,12592-12596,12598-12600,12602-12609,12611-12615,12617,12619-12621,12623,12625,12628-12631,12633-12635,12637,12639,12642,12644,12647-12653,12656,12658,12660,12662-12666,12668-12694,12696,12698-12704,12708-12710,12712-12721,12723-12729,12731-12742,12745-12752,12754-12784,12786-12791,12793-12798,12800-12801,12803,12805-12808,12810-12812,12814,12816-12821,12825-12833,12835-12837,12839-12841,12847,12849-12859,12863-12883,12885-12895,12897-12906,12908-12915,12917-12922,12924-12934,12937-12940,12943-12944,12946-12947,12950-12952,12955-12964,12966-12969,12971,12973-12977,12979-12993,12997-12999,13001-13003,13006-13007,13010-13015,13017-13020,13022-13024,13026-13031,13033,13035-13037,13039-13040,13043,13046-13052,13055-13060,13062-13069,13071-13072,13074,13076-13085,13087-13093,13095-13101,13103-13104,13106,13108-13110,13112,13114-13120,13122,13125-13126,13129,13132-13136,13139-13140,13142,13147,13157-13158,13163,13167,13176,13186,13188,13195,13200

Modified: openlaszlo/branches/4.2/WEB-INF/lps/lfc/kernel/swf9/LzPreloader.as
===================================================================
--- openlaszlo/branches/4.2/WEB-INF/lps/lfc/kernel/swf9/LzPreloader.as	2009-03-06 15:17:33 UTC (rev 13200)
+++ openlaszlo/branches/4.2/WEB-INF/lps/lfc/kernel/swf9/LzPreloader.as	2009-03-06 15:20:45 UTC (rev 13201)
@@ -1,7 +1,7 @@
 /**
   * LzSprite.as
   *
-  * @copyright Copyright 2007, 2008 Laszlo Systems, Inc.  All Rights Reserved.
+  * @copyright Copyright 2007-2009 Laszlo Systems, Inc.  All Rights Reserved.
   *            Use is subject to license terms.
   *
   * based on http://www.ghost23.de/blogarchive/2008/04/as3-application-1.html
@@ -18,7 +18,9 @@
     import flash.events.ProgressEvent;
     import flash.net.navigateToURL;
     import flash.net.URLRequest;
+    import flash.external.ExternalInterface;
 
+    // WARNING: this file is not included automatically - be sure to keep server/src/org/openlaszlo/sc/SWF9External.java in sync!!!!
     public class LzPreloader extends MovieClip {
         public function LzPreloader() {
             stop();
@@ -46,8 +48,7 @@
             var percload:Number = Math.floor(root.loaderInfo.bytesLoaded / root.loaderInfo.bytesTotal * 100);
             var id = stage.loaderInfo.parameters.id;
             if (id) {
-                var js = 'if (window.lz && lz.embed && lz.embed.applications && lz.embed.applications.' + id + ') lz.embed.applications.' + id + '._sendPercLoad(' + percload + ')';
-                navigateToURL(new URLRequest('javascript:' + js + ';void(0);'), '_self');
+                ExternalInterface.call('lz.embed.applications.' + id + '._sendPercLoad', percload);
             }
         }
     }

Modified: openlaszlo/branches/4.2/WEB-INF/lps/lfc/lzpreloader.as
===================================================================
--- openlaszlo/branches/4.2/WEB-INF/lps/lfc/lzpreloader.as	2009-03-06 15:17:33 UTC (rev 13200)
+++ openlaszlo/branches/4.2/WEB-INF/lps/lfc/lzpreloader.as	2009-03-06 15:20:45 UTC (rev 13201)
@@ -1,6 +1,6 @@
 /**
   *
-  * @copyright Copyright 2001-2008 Laszlo Systems, Inc.  All Rights Reserved.
+  * @copyright Copyright 2001-2009 Laszlo Systems, Inc.  All Rights Reserved.
   *            Use is subject to license terms.
   *
   * @affects lzpreloader
@@ -137,11 +137,11 @@
     mc.gotoAndStop(0);
   } else {
     // SWF-specific
-    var percload = _root.getBytesLoaded() / _root.getBytesTotal();
     var id = _root.id;
     if (id) {
-        var js = 'if (window.lz && lz.embed && lz.embed.applications && lz.embed.applications.' + id + ') lz.embed.applications.' + id + '._sendPercLoad(' + Math.floor(percload * 100) + ')';
-        _root.getURL('javascript:' + js + ';void(0);');
+        var percload = Math.floor((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
+        if (percload != this._lastpercload) flash.external.ExternalInterface.call("lz.embed.applications." + id + "._sendPercLoad", percload);
+        this._lastpercload = percload;
     }
 
     for (var i = 0; i < this.synctoloads.length; i++) {

Modified: openlaszlo/branches/4.2/WEB-INF/lps/server/src/org/openlaszlo/compiler/SWF9Writer.java
===================================================================
--- openlaszlo/branches/4.2/WEB-INF/lps/server/src/org/openlaszlo/compiler/SWF9Writer.java	2009-03-06 15:17:33 UTC (rev 13200)
+++ openlaszlo/branches/4.2/WEB-INF/lps/server/src/org/openlaszlo/compiler/SWF9Writer.java	2009-03-06 15:20:45 UTC (rev 13201)
@@ -462,6 +462,7 @@
             "import flash.system.*;\n" +
             "import flash.net.*;\n" +
             "import flash.ui.*;\n" +
+            "import flash.external.*;\n" +
             "}#\n";
 
     /** Create application boilerplate preamble as3 code 
@@ -480,8 +481,10 @@
                 "app = new " + MAIN_APP_CLASSNAME + "(this);\n" +
               "}\n" +
             "}\n";
-        // preloader code from kernel/swf9/LzPreloader.as -- eeek should come from extern file, maybe with JSP interpolation.
-        source += "// based on http://www.ghost23.de/blogarchive/2008/04/as3-application-1.html\n public class LzPreloader extends MovieClip {" + imports + "public function LzPreloader() { stop(); root.loaderInfo.addEventListener(ProgressEvent.PROGRESS,loadProgress); addEventListener(Event.ENTER_FRAME, enterFrame); } public function enterFrame(event:Event):void { if (framesLoaded == totalFrames) { root.loaderInfo.removeEventListener(ProgressEvent.PROGRESS,loadProgress); nextFrame(); var mainClass:Class = Class(loaderInfo.applicationDomain.getDefinition('LzSpriteApplication')); if(mainClass) { var main:DisplayObject = DisplayObject(new mainClass()); if (main) { removeEventListener(Event.ENTER_FRAME, enterFrame); stage.addChild(main); stage.removeChild(this); } } } } private function loadProgress(event:Event):void { var percload:Number = Math.floor(root.loaderInfo.bytesLoaded / root.loaderInfo.bytesTotal * 100); var id = stage.loaderInfo.parameters.id; if (id) { var js = 'if (window.lz && lz.embed && lz.embed.applications && lz.embed.applications.' + id + ') lz.embed.applications.' + id + '._sendPercLoad(' + percload + ')'; navigateToURL(new URLRequest('javascript:' + js + ';void(0);'), '_self'); } } } // end of preloader\n";
+        // TODO: should come from extern file, maybe with JSP interpolation
+        // preloader code from kernel/swf9/LzPreloader.as
+        // BE SURE TO KEEP THIS IN SYNC
+        source += "// based on http://www.ghost23.de/blogarchive/2008/04/as3-application-1.html\n public class LzPreloader extends MovieClip {" + imports + "public function LzPreloader() { stop(); root.loaderInfo.addEventListener(ProgressEvent.PROGRESS,loadProgress); addEventListener(Event.ENTER_FRAME, enterFrame); } public function enterFrame(event:Event):void { if (framesLoaded == totalFrames) { root.loaderInfo.removeEventListener(ProgressEvent.PROGRESS,loadProgress); nextFrame(); var mainClass:Class = Class(loaderInfo.applicationDomain.getDefinition('LzSpriteApplication')); if(mainClass) { var main:DisplayObject = DisplayObject(new mainClass()); if (main) { removeEventListener(Event.ENTER_FRAME, enterFrame); stage.addChild(main); stage.removeChild(this); } } } } private function loadProgress(event:Event):void { var percload:Number = Math.floor(root.loaderInfo.bytesLoaded / root.loaderInfo.bytesTotal * 100); var id = stage.loaderInfo.parameters.id; if (id) { ExternalInterface.call('lz.embed.applications.' + id + '._sendPercLoad', percload); } } } // end of preloader\n";
         return source;
     }
 



More information about the Laszlo-checkins mailing list