[Laszlo-checkins] r12429 - openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9

hqm@openlaszlo.org hqm at openlaszlo.org
Mon Jan 12 10:26:55 PST 2009


Author: hqm
Date: 2009-01-12 10:26:54 -0800 (Mon, 12 Jan 2009)
New Revision: 12429

Modified:
   openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzLibrary.as
Log:
Change 20090112-hqm-j by hqm at badtzmaru.home on 2009-01-12 13:25:36 EST
    in /Users/hqm/openlaszlo/trunk5
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Allow snippets to load into app, when wrapper html file comes from different URL

New Features:

Bugs Fixed: LPP-7615

Technical Reviewer: ptw
QA Reviewer: (pending)
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details:

+ When a snippet is compiled, the URL to load it from at runtime is
baked in as a relative path, like "build/myapp/mylib.lzx.swf".

The SWF9 library loader was creating a new URLRequest using that
relative URL, and when loaded, it would load relative to the current
HTML wrapper's URL, which could be in some place random.

The fix is to construct the library load URL by grabbing
lz.Browser.getBaseURL(), which, in swf9 anyway, seems URL that the app
swf code loaded from rather than the location of the HTML wrapper
page.

This change constructs the the snippet's load URL by appending
lz.Browser.getBaseURL() to the snippet's baked-in relative path.

+ The test case from the bug report may not work in SWF8 and DHTML
either, I haven't tested those runtimes yet. This is just a fix for
swf9.


Tests:

+ test case from bug report
+ regular tests in test/snippets in swf9



Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzLibrary.as
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzLibrary.as	2009-01-12 18:09:06 UTC (rev 12428)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzLibrary.as	2009-01-12 18:26:54 UTC (rev 12429)
@@ -1,7 +1,7 @@
 /**
   * LzLibrary.as
   *
-  * @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.
   *
   * @topic LZX
@@ -156,12 +156,13 @@
         return;
     }
     this.loading = true;
-    var request:URLRequest = new URLRequest(this.href);
+    var loadurl:LzURL = lz.Browser.getBaseURL();
+    loadurl.file = this.href;
+    var request:URLRequest = new URLRequest(loadurl.toString());
     request.method = URLRequestMethod.GET;
     this.loader = new Loader();
     var info:LoaderInfo = loader.contentLoaderInfo;
     info.addEventListener(Event.COMPLETE, handleLoadComplete);
-    trace('loader.load ', this.href);
     this.loader.load(request);
 }
 



More information about the Laszlo-checkins mailing list