3
votes

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

3
did you check the ownership of framework folder, my download of SDK framework folder ownership is wrong. I used chown -R +X to fix. - emj365

3 Answers

0
votes

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).

0
votes

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

0
votes

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.