简体   繁体   English

Flex移动项目不支持mx:Canvas?

[英]Flex mobile project does not support mx:Canvas?

In Flash Builder, if I new a Flex Mobile Project, and paste the following code: 在Flash Builder中,如果我新建了Flex Mobile Project,并粘贴以下代码:

<?xml version="1.0"?>
<!-- Simple example to demonstrate the Halo Canvas layout container. -->
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/mx">
    <s:Group/>
    <mx:Canvas/>
</s:Application>

The "Canvas" line fails to compile. “Canvas”行无法编译。 However it's OK in a Flex Project. 然而,在Flex项目中它是可以的。 My question is, is there any way to use Canvas or other halo controls without modifying the legacy code in Flex Mobile Project? 我的问题是,有没有办法在不修改Flex Mobile Project遗留代码的情况下使用Canvas或其他光环控件? Or, is there any way to use Native Extension in Flex Project? 或者,有没有办法在Flex项目中使用Native Extension? If both are NO, it would be a nightmare. 如果两者都不是,那将是一场噩梦。

My question is, is there any way to use Canvas or other halo controls without modifying the legacy code in Flex Mobile Project? 我的问题是,有没有办法在不修改Flex Mobile Project遗留代码的情况下使用Canvas或其他光环控件?

Yes, you have to add the mx.swc to the library path of your mobile project. 是的,您必须将mx.swc添加到移动项目的库路径中。 It should be located in a place similar to this: 它应该位于类似于这样的地方:

[FrameworkRoot]\frameworks\libs\mx\mx.swc

I'm not sure I'd recommend it; 我不确定我会推荐它; as the MX components are not optimized for mobile usage. 因为MX组件未针对移动设备进行优化。 I'm unclear what a Canvas would offer you that you couldn't get from a Group. 我不清楚Canvas会为你提供什么,你无法从一个集团获得。

is there any way to use Native Extension in Flex Project? 有没有办法在Flex项目中使用Native Extension?

No; 没有; Native Extensions are an AIR feature; Native Extensions是AIR功能; you will not be able to use them in a browser based project. 您将无法在基于浏览器的项目中使用它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM