<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2008/09/10/playing-a-sound-effect-when-an-alert-control-is-displayed-in-flex/ -->
<mx:Application name="Alert_creationCompleteEffect_test_2"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white" viewSourceURL="srcview/index.html">

    <mx:Script>
        <![CDATA[
            import mx.controls.Alert;

            [Embed("assets/iconCritical.png")]
            private var IconCritical:Class;

            private function showAlert():void {
                var message:String = "The quick brown fox jumped over the lazy dog.";
                var title:String = "Alert title";
                var a:Alert = Alert.show(message,
                            title,
                            Alert.OK,
                            null,
                            null,
                            IconCritical);
                a.status = Capabilities.version;
                a.isPopUp = false;
            }
        ]]>
    </mx:Script>

    <mx:Style>
        Alert {
            creationCompleteEffect: ding;
        }
    </mx:Style>

    <mx:SoundEffect id="ding"
            source="@Embed('assets/ding.mp3')"
            useDuration="false" /> 

    <mx:Button id="button"
            label="Launch Alert"
            click="showAlert();" />

</mx:Application>