Section 1.4. Set mxml compiler options in flex Builder
1.4.1. Problem
I want to set mxml compiler options
1.4.2. Solution
Set the compiler parameters in the Project Properties dialog box.
1.4.3. Discussion
The mxml compiler is mxmlc. It compiles the ActionScript and mxml files into SWF files for Flash Player to run. When you run or debug a flex program in flex builder, The mxml compiler is called and the file is passed as a compiler parameter, when you debug the SWF file, it is passed to the mxml compiler as a parameter. For example, you can use the path of an external library file as a parameter, or allow the SWF file to access a local file or set the background color.
To change the project compiler settings, right-click the project name and select Properties (Figure 1-9 ),
Figure 1-9. Change Project Properties
In the following dialog box (Figure 1-10), select flex compiler. There are some options to control how the SWF file is compiled. You can add additional compiler parameters in the input box, you can add multiple parameters at a time, with the (-) symbol before each parameter. parameters are separated by spaces.
Figure 1-10. Set compiler options
Below are some common compiler parameters:
Verbose-stacktraces
Specify the exception information of SwF at runtime to include the row number and file name. This will make the generated SWF file larger. The SwF with verbose-stacktraces is different from the SWF of the debug version.
Source-Path-Element
To add other source code directories or files, you can use wildcard characters to add all files or subdirectories in the directory, or use + = to append new parameters to the default path. For example
-Source-path + =/users/base/Project
Include-libraries
Specify that the SWF file is compiled into the program and link all classes and resources in the library to the SWF. This parameter is useful if your program needs to load other modules.
Library-Path
Similar to the include-libraries option, but only references classes and resources for SWF, this ensures manageability of SWF files.
Locale
Specify the region attribute of the SWF file. For example, use-locale = es_es to specify the SWF region as Spain.
Use-network
Indicates whether SWF can access network services or apply standard Flash Player permission policies. For example,-use-network = false indicates that SWF has access to the local file system but cannot access any network service. The default value is true.
Frames. Frame
Start the application resource proxy stream and publish its interface through the modulemanager class. In special cases, for example, resources have been introduced in the Code but do not need to be moved to the external SWF file, this parameter can greatly reduce the application startup time, which is a complex but useful parameter.
Keep-all-type-selectors
Ensure that all style information is compiled into SWF, and even the program is not used. This is very important because it is possible that other components loaded by the program need the style information. The default value is false, which means that unused style information will not be compiled into SWF.
After setting the compiler parameters, click Apply to save the settings.