what is SWC, when/where we use SWC in Flash
Does any one know what is SWC and where we use this SWC in Flash Develop开发者_JAVA百科ment?
So you know how in AS3 you can import classes by typing in the package name? flash.display.MovieClip, etc?
A .swc basically lets you create a single file that holds a bunch of packages, but also includes any visual DisplayObjects that are associated with those packages. So lets say, for instance, that I have an .fla with 30 images which I want to associate to classes that I can use in other .flas.
Normally with an .fla you would compile to a .swf file, but you also have the option to compile to a .swc. You can set up your file to create something like myPath.images.Image1, myPath.images.Image2, etc. Then you compile to a .swc and put it in the .swc path of any other project. In that project, then, you can just type "import myPath.images.Image1" and you'll automatically have a class that you can instantiate and drop on the stage and boom, you have your image.
It's super useful if you want to:
- easily link up images to code and store that in a small package
- create code that other people can use but can't necessarily look at
- Export both code and graphics from Flash into FlexBuilder, which lacks the graphics/animation tools that flash has.
Make sense?
SWC files make it easy to exchange components and other assets among Flex developers. You need only exchange a single file, rather than the MXML or ActionScript files and images and other resource files. The SWF file in a SWC file is compiled, which means that the code is loaded efficiently and it is hidden from casual view.
.
You can also dynamically link the contents of SWC files. Dynamic linking is when the entire SWF file is loaded at run time. To achieve dynamic linking of the SWF file, you must use the SWC file as a Runtime Shared Library, or RSL.
http://livedocs.adobe.com/flex/3/html/help.html?content=compilers_30.html
Basically, Runtime Shared Libraries.
This flex3 guide will tell you something more.
精彩评论