[Laszlo-checkins] r10646 - in openlaszlo/trunk: WEB-INF/lps/lfc/kernel/swf/dojo/flash8 lps/includes/source

max@openlaszlo.org max at openlaszlo.org
Sat Aug 9 13:25:35 PDT 2008


Author: max
Date: 2008-08-09 13:25:25 -0700 (Sat, 09 Aug 2008)
New Revision: 10646

Modified:
   openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/dojo/flash8/DojoExternalInterface.as
   openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/dojo/flash8/ExpressInstall.as
   openlaszlo/trunk/lps/includes/source/flash.js
Log:
Change 20080808-maxcarlson-m by maxcarlson at Roboto on 2008-08-08 17:53:50 PDT
    in /Users/maxcarlson/openlaszlo/trunk-clean
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: UPDATED: Fix Flash player upgrading for swf9 apps

Bugs Fixed: LPP-6715 - swf9: Need a warning to tell user to upgrade to flash 9 for this release

Technical Reviewer: promanik
QA Reviewer: hminsky

Details:  DojoExternalInterface.as - Don't call loaded() if and installer is running.

ExpressInstall.as - Call initUpdater() with the correct scope.  Add timeout to warn the user if expressinstall fails to laod within 10 seconds.  Fix callback code to use __root.getURL() and call back to the correct API.

flash.js - Set the minimum version to 8.  Downgrade swf9 URLs to load as swf8 so ExpressInstall can run.  Redirect to the player download page if the update fails.

Tests: See LPP-6715



Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/dojo/flash8/DojoExternalInterface.as
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/dojo/flash8/DojoExternalInterface.as	2008-08-09 14:05:13 UTC (rev 10645)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/dojo/flash8/DojoExternalInterface.as	2008-08-09 20:25:25 UTC (rev 10646)
@@ -22,6 +22,7 @@
 	var numArgs = null;
 	var argData = null;
 	var resultData = null;
+	var installing = false;
 	var _id;
 	
 	function DojoExternalInterfaceClass(id){
@@ -32,6 +33,7 @@
 		var install = new ExpressInstall();
 		if(install.needsUpdate){
 			install.init();
+			this.installing = true;
 		}
 
 		// not loaded from the wrapper JS...
@@ -93,6 +95,7 @@
 			interact with the Flash file.
 	*/
 	function loaded(){
+		if (this.installing) return;
 		DojoExternalInterface.call("lz.embed.dojo.loaded", null, this._id);
 		LzBrowserKernel.__jsready();
 	}

Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/dojo/flash8/ExpressInstall.as
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/dojo/flash8/ExpressInstall.as	2008-08-09 14:05:13 UTC (rev 10645)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/dojo/flash8/ExpressInstall.as	2008-08-09 20:25:25 UTC (rev 10646)
@@ -23,11 +23,28 @@
 	var updater = null
 	var hold = null
 	
+    var time = 0;
+    var timeOut = 10;    // expressed in seconds
+    var delay = 10;   // expressed in milliseconds
+
     function ExpressInstall(){
 		// does the user need to update?
 		this.needsUpdate = (_root.MMplayerType == undefined) ? false : true;	
     }
 
+    function checkLoaded(mc){
+        if (mc.startUpdate.toString() == "[type Function]"){
+            // updater has loaded successfully
+            this.initUpdater();
+            this.updater.onEnterFrame = null;
+        } else if(this.time > this.timeOut){
+            // updater did not load in time, abort load and force alternative content
+            this.updater.unloadMovie();
+            this.callBack();
+        }
+        this.time += 1/30;
+    }
+
 	function init(){
 		this.loadUpdater();
 	}
@@ -46,10 +63,7 @@
 
 		// can't use movieClipLoader because it has to work in 6.0.65
 		this.updater.onEnterFrame = function(){
-			if(typeof this.hold.startUpdate == 'function'){
-				_self.initUpdater();
-				this.onEnterFrame = null;
-			}
+            _self.checkLoaded(this.hold);
 		}
 
 		var cacheBuster= Math.random();
@@ -65,11 +79,16 @@
 		this.hold.startUpdate();
 	}
 
+	function callBack(msg = 'Download.Failed'){
+        //Debug.write('callBack', "javascript:lz.embed.dojo.installer._onInstallStatus('"+msg+"')");
+        _root.getURL("javascript:lz.embed.dojo.installer._onInstallStatus('"+msg+"')");
+    }
+
 	function onInstallStatus(msg){
         if (msg == 'Download.Complete') {
-            getURL(_root.MMredirectURL);
+            _root.getURL(_root.MMredirectURL);
         } else {
-            getURL("javascript:dojo.flash.installer._onInstallStatus('"+msg+"')");
+            this.callBack(msg);
         }
 	}
 }

Modified: openlaszlo/trunk/lps/includes/source/flash.js
===================================================================
--- openlaszlo/trunk/lps/includes/source/flash.js	2008-08-09 14:05:13 UTC (rev 10645)
+++ openlaszlo/trunk/lps/includes/source/flash.js	2008-08-09 20:25:25 UTC (rev 10646)
@@ -293,7 +293,7 @@
         bgcolor: '#ffffff',
         wmode: 'window',
         flashvars: '',
-        minimumVersion: 7,
+        minimumVersion: 8,
         id: 'flashObject',
         appenddiv: null
     },
@@ -1254,8 +1254,8 @@
             return true;
         }        
 
-        // other platforms need at least Flash 6 or above
-        if(!lz.embed.dojo.info.isVersionOrAbove(6, 0, 0)){
+        // other platforms need at least Flash 8 or above
+        if(!lz.embed.dojo.info.isVersionOrAbove(8, 0, 0)){
             return true;
         }
 
@@ -1281,6 +1281,14 @@
                 p.flash8 = url;
         }
 
+        // downgrade URL to flash8 so expressinstall can run...
+        var i = url.indexOf('swf9')
+        if (i != -1) {
+            lz.embed.dojo._tempurl = url;
+            url = url.substring(0, i + 3) + '8' + url.substring(i + 4, url.length);
+                p.flash8 = url;
+        }
+
         lz.embed.dojo.ready = false;
         if(lz.embed.dojo.info.capable == false){ // we have no Flash at all
             lz.embed.dojo._isinstaller = true;
@@ -1288,11 +1296,11 @@
             // the user to install things
 
             var installObj = new lz.embed.dojo.Embed(p);
-            installObj.write(8); // write out HTML for Flash 8 version+
+            installObj.write(lz.embed.dojo.minimumVersion); // write out HTML for Flash 8 version+
         }else if(lz.embed.dojo.info.isVersionOrAbove(6, 0, 65)){ // Express Install
             //dojo.debug("Express install");
             var installObj = new lz.embed.dojo.Embed(p);
-            installObj.write(8, true); // write out HTML for Flash 8 version+
+            installObj.write(lz.embed.dojo.minimumVersion, true); // write out HTML for Flash 8 version+
             installObj.setVisible(true);
             installObj.center();
         }else{ // older Flash install than version 6r65
@@ -1317,6 +1325,7 @@
             alert("There was an error downloading the Flash Player update. "
                         + "Please try again later, or visit macromedia.com to download "
                         + "the latest version of the Flash plugin.");
+            window.location = "http://www.macromedia.com/go/getflashplayer";
         }    
     }
 };
@@ -1328,5 +1337,3 @@
 * Copyright 2001-2008 Laszlo Systems, Inc.  All Rights Reserved.          *
 * Use is subject to license terms.                                        *
 * X_LZ_COPYRIGHT_END ******************************************************/
-
-// vim:ts=4:noet:tw=0:



More information about the Laszlo-checkins mailing list