Flex 3 cookbook-tip 1.4 set mxml compiler compilation options in flex Builder

Source: Internet
Author: User

1.4.1 Problem
You need to specify the compilation options of the mxml compiler.

1.4.2 Solution
Set the compilation attribute in the flex compiler Panel of the Project Properties dialog box.

1.4.3 Discussion
The mxml compiler, also known as mxmlc, is an application that compiles the ActionScript and mxml files into SWF files that can be viewed in Flash players.Program. When you run or debug a flex application in flex builder, The mxml compiler is called and the file will be passed to the application as a parameter. when you debug the player, the parameters for creating and debugging SWF will be passed to the mxml compiler. flex builder also allows you to pass some other parameters to the mxml compiler. For example, you can specify an external library path through parameters, allow SWF to access local files, or set the background color.

 

To modify the settings of the Project compiler, right-click the project and select Properties (Figure 1-9) from the association menu, or select project-> properties from the menu bar.

Figure 1-9

 

In the Project Properties dialog box (Figure 1-10), select the flex compiler. there are several options to control how the SWF file is compiled. in the input box labeled "additional compilation Parameters", you can add multiple options. Enter hyphens (-) before each option and use spaces to separate the options.

 

Figure 1-10

 

Below are some common options:

 

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

Add otherSource codeDirectory or file, you can use wildcards to add all files or subdirectories in the directory, or you can use ++ = to append new parameters to the default path, such

-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 then publish its interface through the modulemanager class. In special circumstances, for exampleCodeThe resource has been introduced but does not need to be moved to the external SWF file. In this case, 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.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.