views:

212

answers:

2

When I use mxmlc to compile my mxml file, I get swf file. Now, I want to change the config to make mxmlc compiler generate html file instead, as we can do in Eclipse or Flex Builder. Any solution? Thanks!

+1  A: 

You can't do this. From the documentation:

The mxmlc command-line compiler does not generate an HTML wrapper. You must create your own wrapper to deploy a SWF file that the mxmlc compiler produced. The wrapper is used to embed the SWF object in the HTML tag. It includes the <object> and <embed> tags, as well as scripts that support Flash Player version detection and history management.

Of course, the HTML wrapper is pretty much all boilerplate, apart from the name of the .swf file it wraps. You could create one for a project at the beginning by copying an existing one and changing the .swf-file reference, and that should be good enough most of the time.

Vinay Sajip
A: 

You should use an ant task to build your project. Flex Ant tasks include a html-wrapper task that generates that html. See "Using the html-wrapper task".

bug-a-lot