1
votes

In Flash Builder, if I new a Flex Mobile Project, and paste the following code:

<?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. However it's OK in a Flex Project. My question is, is there any way to use Canvas or other halo controls without modifying the legacy code in Flex Mobile Project? Or, is there any way to use Native Extension in Flex Project? If both are NO, it would be a nightmare.

1
Adobe recommends not using mx components for any mobile applications, as they are not optimized for it. Obviously this does not solve your problem, but it does explain why you are having it. Usually they will work, just not well. Canvas flat out does not work on Mobile, however. - Josh
I thought the recommendation is for new projects. For old ones, better get them run before re-factory. Even it's slow, you can optimize the mx components away as you like, part by part. - willzeng

1 Answers

3
votes

My question is, is there any way to use Canvas or other halo controls without modifying the legacy code in Flex Mobile Project?

Yes, you have to add the mx.swc to the library path of your mobile project. 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. I'm unclear what a Canvas would offer you that you couldn't get from a Group.

is there any way to use Native Extension in Flex Project?

No; Native Extensions are an AIR feature; you will not be able to use them in a browser based project.