[Laszlo-dev] Import statements for SWF9 runtime

Raju Bitter openlaszlonaut at googlemail.com
Wed Jul 2 17:13:57 PDT 2008


I'm trying to add import statements into LZX files for the SWF9 runtime,
using mediastream.lzx as an example.


Here's the LZX code:
<?xml version="1.0" encoding="UTF-8" ?>
<library>
<switch>
    <when runtime="swf9">
      <script when="immediate"><![CDATA[
             #passthrough (toplevel:true) {
                import flash.net.*;
             }#
      ]]>
      </script>
    </when>
</switch>

    <class name="mediastream" extends="node">

And the generated AS3 code:
package {
dynamic class $lzc$class_mediastream extends LzNode {
static var
tagname = "mediastream";static var attributes = new
LzInheritedHash(LzNode.attributes);var url;function $lzc$set_url (url)
{
this._setUrl(url)

So the import statement is not showing up. If I add an extra

if ($swf9) {

}

I run into an error:
Compilation errors occurred:
org.openlaszlo.sc.CompilerError: `if` at top level


Looks like I didn't get something... Any suggestions?

- Raju




More information about the Laszlo-dev mailing list