flex 制作 swc 文件
用 compc 编译器直接编译
命令:
compc -source-path (源文件路径,不能省略) -output (swc 文件路径和名称) -include-classes (类名称)
如:compc -source-path . -output CustomPreloaderSWC.swc -include-classes preload.CustomPreloader
如何导入简单声明文件
如:
<?xml version="1.0"?>
<!-- SimpleManifest.xml -->
<componentPackage>
<component id="MyButton" class="MyButton"/>
<component id="MyOtherButton" class="MyOtherButton"/>
</componentPackage>
<!-- SimpleManifest.xml -->
<componentPackage>
<component id="MyButton" class="MyButton"/>
<component id="MyOtherButton" class="MyOtherButton"/>
</componentPackage>
定义一个命名空间:
-namespace http://mynamespace SimpleManifest.xml
引入命名空间:
compc -source-path . -output c:/jrun4/servers/flex2/flex/WEB-INF/flex/user_classes/MyButtons.swc -namespace http://mynamespace SimpleManifest.xml -include-namespaces http://mynamespace
在app如何使用?如下示例:<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:a="http://mynamespace">
<a:MyButton/>
<a:MyOtherButton/>
</mx:Application>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:a="http://mynamespace">
<a:MyButton/>
<a:MyOtherButton/>
</mx:Application>
引入文件
-include-file name path
例如导入gif图片:

