Source

as3snapi / as3snapi-sandbox / src / SandboxMain.mxml

<?xml version="1.0"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:ui="sandbox.ui.*"
        creationComplete="creationCompleteHandler(event)">
    <s:VGroup width="100%" height="100%">
        <s:HGroup width="100%" chromeColor="green" color="white">
            <s:Button label="Settings" click="button1_clickHandler(event)" />
            <s:Button label="Capture mock snapshot" click="button2_clickHandler(event)" />
        </s:HGroup>
        <ui:MainPanel id="mainPanel" width="100%" height="100%" />
    </s:VGroup>

    <fx:Script><![CDATA[
        import mx.events.FlexEvent;
        import mx.managers.PopUpManager;

        import sandbox.AppController;
        import sandbox.ui.PropsDlg;

        private var appController:AppController;

        private function creationCompleteHandler(event:FlexEvent):void {
            appController = new AppController(mainPanel);
            appController.connect();
            //TODO:            loaderInfo.uncaughtErrorEvents.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, uncaughtErrorHandler);
        }

        //private function uncaughtErrorHandler(event:UncaughtErrorEvent):void {
        //    log(event.error);
        //}

        private function button1_clickHandler(event:MouseEvent):void {
            var propsDlg:PropsDlg = new PropsDlg();
            PopUpManager.addPopUp(propsDlg, this, true);
            PopUpManager.centerPopUp(propsDlg);
        }

        private function button2_clickHandler(event:MouseEvent):void {
            appController.captureMockSnapshot();
        }
        ]]></fx:Script>
</s:Application>