开发者

app fails to compile with mxmlc command-line but works with flash builder IDE

I have this flex app (it's a flex project created from flash builder), and it compiles fine when I build it from the IDE.

it fails to compile when I do it from command line through mxmlc.

I am invoking the mxmlc at the location "flash-builder-installation"\sdks\"flex-ver"\bin\

the mxml file is test.mxml

I don't have any dependency on any of custom swc file.

I am getting the following type errors when I compile it

Error: Type was not found or was not a compile-time constant: TouchEvent

Error: T开发者_开发技巧ype was not found or was not a compile-time constant: File.

Error: Type was not found or was not a compile-time constant: FileStream

could you please let me know what i am missing here ?

thanks,


It looks like you are compiling an AIR application. AIR applications are slightly different than regular Flex web applications. Instead of mxmlc you need to use amxmlc, which is the AIR compiler. It is located within the same path as mxmlc. This will automatically include the AIR SWC libraries.

If you have no other configuration, you can use the simplest command line:

flash-builder-installation"\sdks\"flex-ver"\bin\amxmlc myApp.mxml

If you need help with syntax, try this page for starters: Air Compiler Help

I realize that the reference says Flex 3, but the compiler and options are the same. To get help from the command line, try:

flash-builder-installation"\sdks\"flex-ver"\bin\amxml --help


You're forgetting to include the Air SWCs. They're added automatically when you create an Air project in Flash Builder, but need to include them manually if doing command line.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜