用compc编译器直接编译
命令:
compc -source-path(源文件路径,不能省略) -output(swc文件路径和名称) -include-classes (类名称)
如:compc -source-path . -output CustomPreloaderSWC.swc -include-classes preload.CustomPreloader
如何导入简单声明文件
如:
定义一个命名空间:
引入文件
-include-file name path
例如导入gif图片:
命令:
compc -source-path(源文件路径,不能省略) -output(swc文件路径和名称) -include-classes (类名称)
如:compc -source-path . -output CustomPreloaderSWC.swc -include-classes preload.CustomPreloader
如何导入简单声明文件
如:
<?
xmlversion="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 >
定义一个命名空间:
-namespacehttp://mynamespaceSimpleManifest.xml
引入命名空间:
-include-namespaceshttp://mynamespace
compc实例:
compc-source-path.-outputc:/jrun4/servers/flex2/flex/WEB-INF/flex/user_classes/MyButtons.swc-namespacehttp://mynamespaceSimpleManifest.xml-include-namespaceshttp://mynamespace
在app如何使用?如下示例:
<?
xmlversion="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图片:
compc-include-filelogo.gifc:/images/logo/logo1.gi