1

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: Type 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,

Darren
  • 68,902
  • 24
  • 138
  • 144
charan
  • 13
  • 1
  • 4

2 Answers2

4

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
Jack Viers
  • 320
  • 2
  • 12
  • Strange, I've never seen that before. We have always just used mxmlc in our Ant builds. Is amxmlc just a wrapper to run mxmlc with the proper config? Is there any advantage to using it over the standard compiler? – drkstr Apr 22 '11 at 16:59
  • Thanks for the input. Yes, this is an AIR app. – charan Apr 25 '11 at 12:01
  • Can you maybe provide a link to a good reference of all binaries included with Flex SDK? Their purpose, usage cases, etc. – jayarjo Mar 02 '12 at 07:50
3

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.

J_A_X
  • 12,857
  • 1
  • 25
  • 31
  • ^^^ what he said. You can check out FLEX_HOME/frameworks/air-config.xml to see what they are using for the compiler options. If you are not doing so already, you will probably want to use something like Ant to build from the command line (PS: that config file can be loaded directly into Ant). – drkstr Apr 22 '11 at 16:48