<?xml version="1.0" encoding="utf-8"?>
<mx:Application
    xmlns:mx="http://www.adobe.com/2006/mxml" 
    xmlns="*" 
    
    layout="absolute" width="300" height="200"
    creationComplete="onCreationComplete(event);" viewSourceURL="srcview/index.html">
    
    <fab:FABridge id="fab" xmlns:fab="bridge.*" />
    
    <mx:Script>
        <![CDATA[
            import mx.controls.Alert;
            
            private function onCreationComplete (evt:Event):void {
                
            }
            
            public function js2swfFunc (message:String):void {
                Alert.show(message);
            }
            
            private function onClick ():void {
                ExternalInterface.call('alert', ['called by using ExternalInterface.call']);
            }
            
        ]]>
    </mx:Script>
    
    <mx:Panel height="100%" width="100%" id="canvas">
    
        <mx:Label id="hwLabel" text="Hello Flex World!" visible="false"/>
        
        <mx:Button id="btn" label="js alert called from js"/>
        
        <mx:Button id="btn2" label="js alert called from AS3" click="onClick()"/>
    
    </mx:Panel>

</mx:Application>