I want to use the Event metadata tags to show what types of event my control will dispatch. The syntax looks like:
<fx:Metadata>
[Event(name="eventName", type="MyEvent")]
</fx:Metadata>
It seems like a best practice in Flex/Actionscript to define static variables that define event names like so:
public class MyEvent extends Event
{
public static const EVENT_NAME:String = "eventName";
// Other stuff..
}
It's a great practice since the event name can change easily and not have to be modified throughout the code. So my question is: Is there any way to use this static const in my metadata event tag? I can't seem to do something like this:
<fx:Metadata>
[Event(name="{MyEvent.EVENT_NAME}", type="MyEvent")]
</fx:Metadata>
Am I just ignorant of the proper syntax to do this, or is it impossible? Seems like it's just asking for hard to find bugs if someone decides to change the const since it is not strongly typed here. Thanks in advance!
The bad news is it is impossible :( I dream about this possibility but…
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