Wednesday, September 12, 2007

flex component compiler parameters

today i need to build a flex swc, so create a new flex lib project and put

compc -source-path . -output bin/MySwc.swc -namespace http://www.mynamespace.com myManifest.xml -include-namespaces http://mynamespace.com

if compile form flex builder, use -namespace http://www.mynamespace.com myManifest.xml -include-namespaces http://mynamespace.com

the myManifest.xml will looks similiar as ( from adobe help sample)
<?xml version="1.0"?>

<!--
SimpleManifest.xml -->
<
componentPackage>
<
component id="MyButton" class="MyButton"/>

<
component id="MyOtherButton" class="MyOtherButton"/>
</
componentPackage>


then in another felx project you want to use the lib

<?xml version="1.0"?>

<
mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:myns="http://mynamespace.com">
<
myns:MyButton/>

<
myns:MyOtherButton/>
</
mx:Application>

No comments: