User Guide
44 Creating Custom Events
Now you create an instance of the class by using the static constant, as the following example
shows for the MyButtonConst custom component:
<?xml version="1.0"?>
<!-- events\myComponents\MyButtonConst.mxml -->
<mx:Button xmlns:mx="http://www.adobe.com/2006/mxml"
click="dispatchEvent(new
EnableChangeEventConst(EnableChangeEventConst.ENABLE_CHANGED));">
<mx:Script>
<![CDATA[
import myEvents.EnableChangeEventConst;
]]>
</mx:Script>
<mx:Metadata>
[Event(name="myEnable", type="myEvents.EnableChangeEventConst")]
</mx:Metadata>
</mx:Button>
This technique does not preclude you from passing a string to the constructor.