Use compc to create a database

Source: Internet
Author: User

Use compc to create a library
This chapter is currently discussing how to use flex builder to create a SWC library file. However, if you do not use flex builder or want to create a library file through the automated process, you can use the method described in this section.
This solution uses the command line compiler compc. Compc is an executable command line tool in the bin directory of the Flex framework SDK. Its job is to convert an mxml file into an ActionScript file and compile it into bytecode. In addition, compc can be used to assemble a SWC.
for the flex framework SDK, compc is located in the flex_install/bin directory; In Flex builder, compc is located in the flex_builder_install_dir/sdks/sdk_version/bin directory.
assume that there is a directory SRC that contains all the files you want to include in SWC. The directory structure is as follows:
src/
assets/
icons/
company_logo.jpg
submit_button_up.png
...
COM/
yourcompany/
yourproject/
components/
loginwindow. mxml
bubblescroller. As
...
The following compc command creates a library named companycommon. SWC from the source directory.
compc-source-Path = Src-output = bin/companycommons. SWC-include-classes
COM. yourcompany. yourproject. components. loginwindow

Com. yourcompany. yourproject. components. bubblescroller


Compc options
When using compc to create a library, if you plan to include other content in SWC, you need to use some command line options.
-Source-path: Specifies the directory where the class file is located. If a command is provided under the src directory, all class files are assumed to be located in this directory.
-Include-classes: This option is used to name the class to be compiled and add it to the library. In this example, there are only two classes, but if there are many classes, you need to add them to each. This is a very monotonous process, but we can see that flex builder is very useful.

-Output: This option is used to name the final SWC file.


Add resources
in the preceding example, only class files are added to companycommons. SWC library file. To add resources, you must include them explicitly:
compc-source-Path = Src-output = bin/companycommons. SWC
-include-classes 'com. yourcompany. yourproject. components. loginwindow
COM. yourcompany. yourproject. components. value required for bubblescroller
-include-files company_log.jpg assets/icons/company_logo.jpg
assets/icons/submit_button_up.png
-include-Files is paired, including the name and path. The name is unique for the resource file and the path is relative The path of the resource that includes the file name. This may be redundant because the file name is generally used as the unique name of the resource, but this is also possible:
-include-file logo assets/icons/company_logo.jpg buttonup
assets/icons/submit_button_up.png

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.