<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
    xmlns:custom="components.*" creationComplete="init()" viewSourceURL="srcview/index.html">

    <mx:Script>
        <![CDATA[

            import mx.controls.Alert;
            import events.MyCustomEvent;

            private function init():void {
                addEventListener(events.MyCustomEvent.MY_CUSTOM_EVENT, function (event:MyCustomEvent):void {
                    Alert.show('howdy from the main app: ' + event.state);
                });            
            }

        ]]>
    </mx:Script>
    
    <mx:VBox top="20" left="20" >
        <custom:StateChange myLabel="button one" state="button one" />
        <custom:StateChange myLabel="button two" state="button two" />
        <custom:StateChange myLabel="button three" state="button three" />
    </mx:VBox>

</mx:Application>