Actionscript 3 如何使用OpenLaszlo 5.0将ActionScript 3导入语句添加到LZX类定义中?
我正在使用未发布的OpenLaszlo 5.0(trunk)版本开发OpenLaszlo应用程序。在我的一个类中,我需要导入ActionScript3类。添加此类导入语句的推荐方法是什么?LZX支持passthrough标记。passthrough标记又有一个when属性,您可以在其中指定一个布尔表达式,例如$as3或$swf10:Actionscript 3 如何使用OpenLaszlo 5.0将ActionScript 3导入语句添加到LZX类定义中?,actionscript-3,flash,openlaszlo,Actionscript 3,Flash,Openlaszlo,我正在使用未发布的OpenLaszlo 5.0(trunk)版本开发OpenLaszlo应用程序。在我的一个类中,我需要导入ActionScript3类。添加此类导入语句的推荐方法是什么?LZX支持passthrough标记。passthrough标记又有一个when属性,您可以在其中指定一个布尔表达式,例如$as3或$swf10: <canvas debug="true"> <class name="foo"> <passthrough when
<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>
导入flash.system.Capabilities;
如果($as3){
Debug.info(Capabilities.os);
}否则{
Debug.info(“flash.system.Capabilities只能在SWFx运行时使用”);
}
对于SWFx运行时,导入语句随后被注入Generated ActionScript 3类。谢谢,这正是我一直在寻找的。OpenLaszlo支持使用switch和when标记的另一种语法,但是如果使用这些标记,则无法将类/模块预编译到LZO库中。