[Laszlo-dev] using SWC-Libraries in SWF9, using ActionScript3 Libraries

Sebastian Wagner seba.wagner at gmail.com
Mon Sep 1 07:19:12 PDT 2008


hi,

2008/9/1 Henry Minsky <hminsky at laszlosystems.com>

>
>
> On Mon, Sep 1, 2008 at 5:23 AM, Sebastian Wagner <seba.wagner at gmail.com>wrote:
>
>> hi,
>>
>> there are numerous of SWC-Libraries available for Flex. How can we make
>> them available in OpenLaszlo in SWF9? Is there a Library directory on Server
>> Side where I can put all my SWC libraries? Or can I pass *manually*
>> library-Files to the mxml-Compiler by adding some attributes to the LZX-App?
>>
>> What do you think? Any ideas on how-to implement that?
>>
>
> That is a good question. I can see advantages to both approaches; if there
> were a common lib directory, then the developer could put their SWCs in
> there, and there would be no need to specify a library path explicitly. On
> the other hand, it would be more modular to put an applications custom SWC
> libraries inside of the app directory someplace.
>
> Perhaps we should have two mechanisms;
>
> 1)  a common flexlib/ directory which is added as a library path to every
> compilation, say in WEB-INF/flexlib
>
> 2) add a well known directory named "flexlib" which is a subdirectory of
> the application's directory, to the search path.
>

*=>* I think implementing both ways would be excellent but for getting
started the first solution would be sufficient for most of the developers


>
> The other issue is how to allow the user to conveniently insert the needed
> as3 "import" statements
> at the proper place in their code. We have a mechanism now for hand-written
> javascript code in the
> LFC, which looks like this (this example is from some swf9 kernel code)
>
> public class LzIdleKernel  {
>
>     #passthrough (toplevel:true) {
>     import flash.display.*;
>     import flash.events.*;
>     import flash.utils.*;
>     }#
>
>
>
> The "passthrough (toplevel:true)" pragma causes the block of code to get
> inserted inside the default "package" block, but outside of the class
> declaration, so the code above actually expands to
>
> package {
>
>     import flash.display.*;
>     import flash.events.*;
>     import flash.utils.*;
>     public class LzIdleKernel {
>
>
> So this would be sufficient for writing libraries in the style of drawview,
> or the video library that Raju Bitter
> was working on adding swf9 support for.
>
> However we don't have any way to conveniently insert as3 import statments
> in pure LZX code right now.
> Perhaps we need some kind of <passthrough> tag which could allow for that.
>
>
>
>
>
>> You can test that by for example using the flexlib.swc of the Flexlib
>> Project: http://code.google.com/p/flexlib/downloads/list
>>
>> The other question would be how-to load simple Actionscript3 Libraries to
>> the Application. For example the XIFF library (
>> http://www.igniterealtime.org/projects/xiff/) for instant messaging using
>> the Jabber protocol.
>>
>
> Do you mean loading as3 libraries at runtime, rather than linking them into
> the app at compile time? What is the mechanism for doing that in as3
> applications?
>

*=>* I mean linking them at compile time. I think in AS3 you cannot
reference Classes which are unknown at compile time, so you need them all
available at compile time.
For linkage at compile time you just add import statements as you have shown
above to your AS3-class or mxml-script area.



>
>>
>> Is this already on the todo list of features for SWF9? Idea's howto
>> implement it?
>>
>
> We've been so busy getting the basic swf9 runtime working that we haven't
> had time to
> think about user-defined libraries and runtime loading, but this is a good
> time to discuss it!
>
>
>
>
>
>
>>
>> sebastian
>>
>
>
>
>
>
>>
>> --
>> Sebastian Wagner
>> http://www.webbase-design.de
>> http://openmeetings.googlecode.com
>> http://www.laszlo-forum.de
>> seba.wagner at gmail.com
>>
>
>
>
> --
> Henry Minsky
> Software Architect
> hminsky at laszlosystems.com
>
>
>


-- 
Sebastian Wagner
http://www.webbase-design.de
http://openmeetings.googlecode.com
http://www.laszlo-forum.de
seba.wagner at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.openlaszlo.org/pipermail/laszlo-dev/attachments/20080901/df290da5/attachment-0001.html


More information about the Laszlo-dev mailing list