September 11, 2003
You've probably already heard about how components work in MX 2004. Well, if you haven't, when you create a component, you can actually generate a file with a .swc extension from the component you build in Flash. This is an external file that you can share with others without having to share your component code. From the docs, it sounds like the .swc file is actually a compiled version of the component, but I wondered...why not just have it as an .swf file? What's so special about this .swc file format?
After examining the file a little more closely, it turns out that you can actually unzip the .swc file (I used Winzip). When I tried that, to my surprise, it unzipped a plethora of stuff. Here are some of the things I found:
1) The actual compiled component file (.swf). I assume you could also just take this file and use loadMovie() to use it at run-time.
2) A graphic file (a .png in this case) that is used as the icon in the library (and component panel?).
3) A bunch of files with .asi extension. Upon opening one of these, I noticed a few things. It looks like these contain content from the actual classes that are used within the component. However, the code has been stripped down to just the member names (ie. property and functions), member access and data types. None of the actual implementation code is there. The other thing is that the class has been converted to "intrinsic". I'm a little curious as to what this keyword actually does since all of the built in classes seem to use this as well.
4) A file called "catalog.xml". This is maybe the most interesting part of it all, as it contains a bunch of data that I assume is to be used in the Component Inspector(?), but I didn't really understand a lot of it just by looking at it. It listed a bunch of classes associated with the component as well as actual assets used in the component. I'd love to get more details on exactly what all this does.
It also listed an xmlns located at http://www.macromedia.com/flash/swccatalog/7. Not sure exactly what that's doing, but when I go to that url, it just redirects me to the Flash product page.
Anyone have any insights?
Posted by philter at September 11, 2003 02:43 PMComments Disabled