[Laszlo-dev] OpenLaszlo, LFC and Runtime Shared Libraries (RSL)

André Bargull andre.bargull at udo.edu
Wed Mar 11 08:49:41 PDT 2009


Hi Raju,

you can use the "flash9_rsl-1.tar" file from 
"http://jira.openlaszlo.org/jira/browse/LPP-7387", there is a 
"MyFactory" class which includes the required code from 
mx.core.FlexApplicationBootstrap and mx.core.FlexModuleFactory to load 
and execute RSLs. If it isn't possible to use that class due to 
copyright or license issues, you can also use the 
mx.core.FlexApplicationBootstrap. (I've only created "MyFactory" class 
to get a smaller rsl-loader. There is an annotation in BaseMain.as 
("flash9_rsl.tar"), which shows the difference in size:
[Frame(factoryClass="MyFactory")] // 8512 bytes [modified 
FlexApplicationBootstrap]
[Frame(factoryClass="mx.core.FlexApplicationBootstrap")] // 16510 bytes

To load the LFC-RSL, you need to adjust at least LzSpriteApplication, 
something like:
---
[Frame(factoryClass="MyFactory")] // this will be the rsl-loader for 
this class
[ExcludeClass] // just copied over from inspected Flex code..
public class LzSpriteApplication extends MovieClip {
   public var app:LzApplication;
   public function LzSpriteApplication () {
     app = new LzApplication(this)
   }
}
---

See, BaseMain.as and SimpleMain.as in "flash9_rsl-1.tar".


- André


On 3/11/2009 4:11 PM, Raju Bitter wrote:
> Andre,
> 
> Henry told me that you have already been testing the RSL functionality 
> for OpenLaszlo. I managed to compile an OpenLaszlo application without 
> the LFC into a nice and small SWF file.
> 
> The normal compile command uses the setting:
>  >> 
> -compiler.library-path+=/Users/rajubitter/src/svn/openlaszlo/trunk/lps/includes/lfc/LFC9.swc 
> 
> In that case an empty canvas compiles to an SWF with the file size of 
> 107006 bytes (with trunk)
> 
> If I use the setting:
>  >> 
> -runtime-shared-library-path=/Users/rajubitter/src/svn/openlaszlo/trunk/lps/includes/lfc/LFC9.swc,http://www.rajubitter.com/rsls/LFC9.swf 
> 
> the compiled file has a size of 1751 bytes.
> 
> What would it take to make our AS3 code load RSL files. Based on what 
> I've read that is only possible for applications based on 
> mx.core.Application or mx.core.SimpleApplication.
> 
> The code for handling RSLs is buried in the FlexModuleFactory.as, here's 
> the SVN link: 
> http://opensource.adobe.com/svn/opensource/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/FlexModuleFactory.as 
> 
> 
> I don't know how complex it would be to add that behavior to OpenLaszlo, 
> but it would make a scenario where you embed multiple SWF OpenLaszlo 
> apps into one HTML page interesting.
> 
> - Raju
> 


More information about the Laszlo-dev mailing list