I want to use Event metadata tags to show what types of events will be sent by my controller. The syntax looks like this:
<fx:Metadata> [Event(name="eventName", type="MyEvent")] </fx:Metadata>
In Flex / Actionscript, it seems to be best to define static variables that define event names like this:
public class MyEvent extends Event { public static const EVENT_NAME:String = "eventName";
This is a good practice, as the event name can be easily changed and should not be changed throughout the code. So my question is: is there a way to use this static const in a metadata event tag? I can not do something like this:
<fx:Metadata> [Event(name="{MyEvent.EVENT_NAME}", type="MyEvent")] </fx:Metadata>
I just donβt know the correct syntax to do this, or is it impossible? It seems that he simply asked to find it difficult to find errors if someone decides to change const, since it is not strictly specified here. Thanks in advance!
Ocelot20
source share