[Laszlo-dev] using SWC-Libraries in SWF9, using ActionScript3 Libraries
Henry Minsky
hminsky at laszlosystems.com
Mon Sep 1 06:50:00 PDT 2008
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.
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?
>
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.openlaszlo.org/pipermail/laszlo-dev/attachments/20080901/35955bdc/attachment.html
More information about the Laszlo-dev
mailing list