Hi, I have a small problem with custom metadata in my Flex project.
Our problem is that the custom metadata is not being read correct by
the flash.utils.describeType.
We have a parent class and multiple child classes, as shown below. We
have the mediate metadata in the parent class to avoid dublicates of
the string.
public class Parent
{
public function Parent()
{
}
[Mediate(event="testSwizMediate")]
public function testSwizMediate():void{
Alert.show("This should not happen");
}
}
public class Child1 extends Parent
{
public function Child1()
{
super();
}
override public function testSwizMediate():void {
Alert.show("This is child nr 1");
}
}
When we have the Parent og Childs either within the main Flex project
or we have them in a library that is merged into code, everything
works great and we see the alert. The describeTye then looks like
this:
<type name="child::Child1" base="parent::Parent" isDynamic="false"
isFinal="false" isStatic="false">
<extendsClass type="parent::Parent"/>
<extendsClass type="Object"/>
<method name="testSwizMediate" declaredBy="child::Child1"
returnType="void">
<metadata name="Mediate">
<arg key="event" value="testSwizMediate"/>
</metadata>
</method>
</type>
But when the parent and child are within a rsl library the
describeType looks like this:
<type name="child::Child1" base="parent::Parent" isDynamic="false"
isFinal="false" isStatic="false">
<metadata name="__go_to_definition_help">
<arg key="file" value="C:\gf-dev-workspace
\workspace-2\TestSwizRslBib2\src\child\Child1.as"/>
<arg key="pos" value="109"/>
</metadata>
<extendsClass type="parent::Parent"/>
<extendsClass type="Object"/>
<method name="testSwizMediate" declaredBy="child::Child1"
returnType="void">
<metadata name="__go_to_definition_help">
<arg key="file" value="C:\gf-dev-workspace
\workspace-2\TestSwizRslBib2\src\child\Child1.as"/>
<arg key="pos" value="265"/>
</metadata>
</method>
</type>
Does anyone have any idea why the metadata ends up as
__go_to_definition_help when they are inn a rsl and it is the parent
that has the metadatainformation?
And we do have the -keep-as3-metadata Autowire Mediate as compiler
option on all. I have also tried to build as release version since I read
somewhere that the __go_to_definition_help is debug stuff, but then the
metadata is entirely gone from the describe type.
Thanks in advance!