flex制作swc文件(转载)

原文地址:http://blog.csdn.net/bjbs_270/archive/2007/08/18/1749530.aspx

用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>

定义一个命名空间:

-namespace http://mynamespace SimpleManifest.xml

引入命名空间:

-include-namespaces http://mynamespace

compc实例:

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"&gt;
<a:MyButton/>
<a:MyOtherButton/>
</mx:Application>

引入文件
-include-file name path
例如导入gif图片:

compc -include-file logo.gif c:/images/logo/logo1.gi

Advertisements

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s

%d 博主赞过: