| ShockWave Component (SWC) | |
|---|---|
| Filename extension | .swc |
| Internet media type | application/octet-stream |
| Magic number | PK\003\004 |
| Developed by | Adobe Systems |
| Type of format | ClassLibrary |
| Container for | XMLSWFCSS |
| Extended from | ZIP |
AnSWC file is a package ofprecompiledFlash symbols andActionScriptcode that allows a Flash orFlexdeveloper to distribute classes and assets, or to avoid recompiling symbols and code that will not change.[1][2] SWC files can be generated by theAdobe Flash Professional authoring tool, and byFlash Builder (or its companion compilerMXMLC).[3] They are sometimes referred to as classlibraries and cannot be directly executed by theFlash Player.
SWC code libraries are typically included in an ActionScript 3 project, and compiled into the finalSWF file alongside the developer's program, by the ActionScript 3 compiler. Only the classes that have been used by the project (and their dependencies) are transferred into the resulting SWF file.
A SWC file iscompressed by means of theZIP archive format.[4] Renaming the extension of a SWC file to "zip" will allow any ZIP-compatible decompression software to show the contents of the file.
An uncompressed SWC file contains at least a catalog.xml file, and aSWF file, usually named "library.swf". It may also contain other files, such asCSS files. The catalog contains a list of the ActionScriptclasses contained in the library, their dependencies, and modification dates.
This is a simple example of a catalog.xml for a SWC created inFlash CS4 which contains two sounds.
<?xml version="1.0" encoding="utf-8"?><swcxmlns="http://www.adobe.com/flash/swccatalog/9"><versions><swcversion="1.2"/><flashversion="10.0"build="d566"platform="MAC"/></versions><features><feature-script-deps/><feature-files/></features><libraries><librarypath="library.swf"><scriptname="ButtonClickSound"mod="1275949831598"><defid="ButtonClickSound"/><depid="AS3"type="n"/><depid="flash.media:Sound"type="i"/></script><scriptname="EndGameSound"mod="1275949831598"><defid="EndGameSound"/><depid="AS3"type="n"/><depid="flash.media:Sound"type="i"/></script></library></libraries><files></files></swc>