SWC Embedding problems

Source: Internet
Author: User

Today we continue to explore the SWC problem. There has been no authoritative guidance on how SWC is used, so every time I have a question I always test myself. Today I have another question: what is the relationship between SWC and SwF volume in a Flex project? Knowing this can make it better for us to do the project. So I made the following three assumptions about the introduction of SWC:

1. Assuming 1:1 but the project contains SWC (i.e., SWC under the Lib folder), the resources in the SWC are all embedded in the SWF and the SWF file increases

2. If you refer to a resource in a SWC, all the resources of this SWC are embedded in the SWF file. Do not embed when not in use

3. Suppose three: referencing a resource in a SWC will only embed this resource in the SWF file, and the other useless will not embed

So I started to do the verification. into a inside containing two MP3 (each 3M or so) file SWC, placed in the Lib directory. Because the Lib directory has been set up to reference SWC, the project has included the SWC. Then look at the generated SWF, only 50 more than the K comparison, So suppose that one is not correct

I am new in the main file to see the generated SWF size is more than 2M, the new two sound generated SWF is more than 5M. This proves the assumption that the third is correct.

Conclusion: Referencing a resource in a SWC will only embed this resource in the SWF file, and the rest will not be embedded. Therefore, we can safely and boldly put the material and resources of each module into the SWC, without having to generate a SWC per module (if you feel it is necessary to separate and separate), Flex will only embed the resources you use into the SWF file.

In addition, only import a class of resources, Flex does not embed it, only you import and Var a:sound will be embedded after

SWC Embedding problems

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.