I have a component library. It has a manifest file that looks like this:
<?xml version="1.0"?>
<componentPackage>
<component id="AutoComplete" class="be.edge.components.AutoComplete" />
<!-- more components left out for brevity -->
</componentPackage>
I compile the library through FlashBuilder with these compiler settings:
When I use the compiled library in other FlashBuilder projects everything works as expected. I get code completion and when I select a suggestion from the code completion a namespace attribute is automatically added to the component, like this:
<s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:ns="library://ns.edge.be" >
<ns:AutoComplete />
</s:Skin>
But: FlashBuilder automatically creates the prefix 'ns'. I would like to customize this to 'e' for instance. How can I make FlashBuilder use this custom prefix by default?
I have two reasons for this:
EDIT:
I also pass a config.xml to the compiler that has the following declarations relating to namespaces:
<compiler>
<namespaces>
<namespace>
<uri>library://ns.edge.be</uri>
<manifest>manifest.xml</manifest>
</namespace>
</namespaces>
</compiler>
<include-namespaces>
<uri>library://ns.edge.be</uri>
</include-namespaces>
This used to work:
Create a file called design.xml
in your /src folder:
<?xml version="1.0" ?>
<design>
<namespaces>
<namespace prefix="mangos" uri="http://com.mangofactory.sample/mxml/2010" />
</namespaces>
</design>
Create a file called manifest.xml
in your /src folder:
<componentPackage>
<component id="MyClass" class="com.mangofactory.framework.MyClassTag"/>
</componentPackage>
Configure your Namespace URL, etc in the build properties:
This is supposed to cause flash builder to prompt as follows:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:mangos="http://com.mangofactory.sample/mxml/2010">
<fx:Declarations>
<mangos:MyClass />
</fx:Declarations>
</s:Application>
(Note that the class appears as MyClass
instead of MyClassTag
, and the namespace appears as mangos
)
However, I just tried doing this, and although the class was renamed correctly, the namespace appeared up as ns
. I know this used to work in FB3.x, maybe I've either forgotten a step, or FB4.5 has broken it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With