Flex 3 includes a Java-based compiler API that lets you compile SWF and SWC files from Java applications. The API supports all the same options as the mxmlc and compc command-line tools. The API includes classes like Application, Logger, and Project.
Downloads
The API's JavaDocs are here: flex_compiler_api.zip (245K)
There is a PDF which describes usage here: Compiler API Guide (194K)

Hi, i just tryed a sample application as suggested in the pdf document but i always get this error message :
Exception in thread "main" java.lang.NoSuchMethodError: flex2.compiler.API.usePathResolver(Lflex2/compiler/common/SinglePathResolver;)V
Please help!
I don't know what lib i am missing...i have mxmlc.jar and flex-compiler-oem.jar in my classpath...
For more informations on my error see this url:
http://tech.groups.yahoo.com/group/flexcoders/message/103646