Personal tools

Runtime Internals

From OpenLaszlo

Contents

Sources

The runtime (LFC) sources are in $LPS/WEB-INF/lps/lfc. There's an ant build file in that directory.

FAQ

Q. Can anyone explain to me why LzLoader.getLoadMovie creates a movieclip, and then LzLoadQueue.loadMovieProxiedOrDirect creates a new movieclip attached to that actually has loadMovie called on it? Is this extra level just something you have to do in Flash?

I think it was because Adam wanted a place to hang some extra parameters that wouldn't get flushed away when the actual movie got loaded, so he made a container movie clip which the actual loader movieclip would be a child of? The load movie command replaces everything that is in the target clip with the new contents.

Notes

You can get the background movieclip ref as this.__LZbgRef.


Adding a New Runtime =

This is what I needed to edit to add the 'mobile' runtime

+ modify lps/admin/dev-console.lzx if needed to add GUI buttons

+ edit build.properties, add line for ant to build runtime:

 build.lfc.runtime.mobile = true

+ compiler/Main.java:

 add "mobile" to 'USAGE' constant (this ought to be computed from C

+ compiler/Compiler.java:

Edit constants KNOWN_RUNTIMES, SCRIPT_RUNTIMES, BINARY_LINKABLE_RUNTIMES, GLOBAL_RUNTIME_VARS,

add "mobile"

+ compiler/CompilationEnvironment.java:

- edit getCompileTimeConstants, add "$mobile"
- edit setRuntimeConstants, set "$mobile" (and $dhtml in this case)

sc/lzsc.java:

  + add "mobile" to list of supported runtimes


templates/html-response.xslt

  - add "or 'mobile'" to tests
             <xsl:when test="(/canvas/@runtime = 'dhtml') or (/canvas/@runtime = 'mobile') ">

templates/embed-body.xslt

  - add "or 'mobile'" to tests
             <xsl:when test="(/canvas/@runtime = 'dhtml') or (/canvas/@runtime = 'mobile') ">