如何添加用OpenLaszlo 5.0 ActionScript 3的import语句LZX类定义? [英] How can I add ActionScript 3 import statements to LZX class definitions with OpenLaszlo 5.0?

查看:161
本文介绍了如何添加用OpenLaszlo 5.0 ActionScript 3的import语句LZX类定义?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用OpenLaszlo 5.0(主干)的未发行版本的OpenLaszlo应用程序。在我班的一个我需要导入的ActionScript 3类。什么是推荐的方式来增加这种import语句?

I'm working on an OpenLaszlo application using the unreleased version of OpenLaszlo 5.0 (trunk). In one of my classes I need to import ActionScript 3 classes. What is the recommended way to add such import statements?

推荐答案

LZX支持的直通的标记。反过来的直通的标记都有一个的的属性,在这里你可以指定一个布尔EX pression,例如: $ AS3或$ SWF10:

LZX supports the passthrough tag. The passthrough tag in turn has a when attribute, where you can specify a boolean expression, e.g. $as3 or $swf10:

<canvas debug="true"> 

  <class name="foo"> 
    <passthrough when="$as3"> 
      import flash.system.Capabilities; 
    </passthrough> 
    <handler name="oninit"> 
      if ($as3) {
        Debug.info(Capabilities.os);
      } else {
         Debug.info("flash.system.Capabilities can only be used in the SWFx runtime");
      }
    </handler>
  </class>

  <foo />

</canvas>

对于SWFX运行时,import语句,然后注入到genereated ActionScript 3的类。

For the SWFx runtime, the import statement is then injected into the genereated ActionScript 3 class.

这篇关于如何添加用OpenLaszlo 5.0 ActionScript 3的import语句LZX类定义?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆