Flash Tutorials - Herong's Tutorial Examples - Version 3.02, by Dr. Herong Yang
"mxmlc" - Adobe Flex Compiler
This section provides a tutorial example on how to use Adobe Flex compiler, mxmlc, to compile a Flash application from a MXML file to a SWF file.
The most important tool included in Flex SDK 4.1 is the Flash application command-line compiler "mxmlc", which allows you to compile MXML (Macromedia XML) and AS (ActionScript) files into SWF files.
MXML is an XML-based language designed to write Flash applications. Here is a simple Flash application, hello.mxml, written in MXML:
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:s="library://ns.adobe.com/flex/spark"> <s:layout> <s:VerticalLayout/> </s:layout> <s:Panel title="My Application"> <s:Label text="Hello World" fontWeight="bold" fontSize="24"/> </s:Panel> </s:Application>
To compile this application from an MXML file to a SWF file, you need to run the "mxmlc" command as shown below:
C:\herong>\local\flex\bin\mxmlc hello.mxml Loading configuration file C:\local\flex\frameworks\flex-config.xml C:\herong\hello.swf (38342 bytes)
Now open hello.swf in Firefox, you should see the application running
as shown in this picture:
Cool. Adobe Flex compiler, mxmlc, seems to be easy to use.
Last update: 2010.
Table of Contents