4

I'm trying, without success, to compile an ActionScript "Hello World" into a SWF file.
This is what I've done so far:

  1. I downloaded Flex SDK 4.6 from here
  2. I created a "hello world" .as file using the examples in here
  3. I try to compile the .as file following the instructions in this page

I'm using the command line:

D:\flex_sdk_4.6\bin\mxmlc.exe test.as

And the result I get is:

Loading configuration file D:\flex_sdk_4.6\frameworks\flex-config.xml
Error: null

What am I missing or doing wrorg?
Should I not get at least compilation errors if my ActionScript code was wrong?
I'll apreciate some directions please.

PS: I also tried with Apache Flex 4.9 but I get the exact same result Error: null

GetFree
  • 40,278
  • 18
  • 77
  • 104

3 Answers3

0

Hum, you are meant to have a configuration file that is shipped with the SDK: \somwhere\Adobe\Adobe Flash Builder 4.6\sdks\4.6.0\frameworks\flex-config.xml (I double checked and it is in the adobe's zip). How did you install the framework?

BTW, I'll suggest you to use an IDE to compile it because you have to pass a configuration file to the compiler and this is not that easy w/o help.

Otherwise, take a look to the ant task that has been designed for automated compilation.

http://livedocs.adobe.com/flex/3/html/help.html?content=anttasks_1.html

Finally, I'll recommend you to have a well automated and structured project with a maven description file.

HIH

poussma
  • 7,033
  • 3
  • 43
  • 68
0

mxmlc by default look for flex-config.xml, unless you specify a config file using -load-config parameter. Does this file exist in your frameworks directory D:\flex_sdk_4.6\frameworks\flex-config.xml ?? If yes, then probably the sdk you downloaded is corrupted, try to download again (wild guess).

Chetan Sachdev
  • 738
  • 1
  • 12
  • 31
  • Yes, the file is there. I also downloaded Apache Flex 4.9 from http://flex.apache.org/download-binaries.html and tried to compile the file, but I get the same error. – GetFree Mar 04 '13 at 12:24
  • are you getting out of memory error.. can you try running mxmlc in verbose mode, to get a detailed error on the console. – Chetan Sachdev Mar 05 '13 at 07:12
  • If you are running out of memory try editing mxml.bat in Apache Flex 4.9 bin directory ie change -Xmx384m to value more suited to your OS and project. – Justin Mclean Mar 05 '13 at 20:18
0

It turns out that the mxml compiler doesn't give you any compilation error at all on some cases, like when you omit the package statement or when you put the use namespace statement in the wrong place.
I was assuming that if my code was wrong then the compiler would through some kind of error, and since it didn't I thought the problem was somewhere else. I was wrong.

Moral of the story: Never assume things are going to work in the expected way. Common sense is far from common.

GetFree
  • 40,278
  • 18
  • 77
  • 104