开发者

Flex Library Project: NativeMenu vs. ContextMenu

开发者 https://www.devze.com 2023-01-07 14:14 出处:网络
I have a Flex Library Project which has both Flex specific classes, and Air specific classes. When I reference the library in an Air project, the compiler complains about an overriding contextMenu i

I have a Flex Library Project which has both Flex specific classes, and Air specific classes.

When I reference the library in an Air project, the compiler complains about an overriding contextMenu in mx.containers.Panel, saying that the param should be of type NativeMenu (instead of ContextMenu). If I switch it over to NativeMenu then it compiles fine.

The issue is when I reference the library in a Flex Project. This time it complains that it doesn't know the type NativeMenu. If I try to change it back to ContextMenu, then I get the same error as above.开发者_Python百科

I've searched google to no avail (found that someone else encountered the exact same problem: http://forums.adobe.com/thread/598791?tstart=-1 )

The docs don't help too much either, except stating the above: http://livedocs.adobe.com/flex/3/langref/flash/display/InteractiveObject.html#contextMenu

I'm thinking that its just not possible to do the mixing of Flex vs Air SDKs that I want, but I was hoping that maybe someone has figured this out.

Thanks!


You can't really target the web Flash Player and the desktop Player using the same project.

I would recommend encapsulating out as much functionality as possible into a library project. Then create a single Flex project and a single AIR project, both using the same library project.

Each respective project can extend, or replace, the different functionality.


I am not sure if this is the exact same problem, but I was having an issue with being able to reference the AIR libraries in a Flex Library project and found the (rather simple) solution.

Using Flash Builder 4.5, when creating a Flex Library Project, (right-click .. New.. Flex Library Project) there is a checkbox for "Include Adobe Air Libraries" at the bottom. This must be checked or AIR libraries will not be included.

When you select the version of SDK/AIR you are using in the dropdown, the message should also indicate what the minimum version of AIR required is for your application.

0

精彩评论

暂无评论...
验证码 换一张
取 消