<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" backgroundGradientAlphas="[1.0, 1.0]" backgroundGradientColors="[#000000, #CC0000]" width="400" height="300" viewSourceURL="srcview/index.html">
    
    <mx:Script>
        <![CDATA[
            
            [Bindable]
            private var myFlashChild:MovieClip;
            
            private function init():void{
                myFlashChild = flashLoader.content as MovieClip;
            }
            
            private function communicateToFlash():void{
                myFlashChild.setTextFromFlex(flexTxt.text)
            }
            
        ]]>
    </mx:Script>
    
    <mx:Image y="10" source="assets/FLEX.png" horizontalCenter="0"/>
    <mx:SWFLoader y="150" source="assets/flash_comm.swf" horizontalCenter="0" id="flashLoader" complete="init()"/>
    <mx:Image y="60" source="assets/arrow.png" horizontalCenter="-174"/>
    <mx:Image y="60" source="assets/arrow.png" horizontalCenter="174"/>
    <mx:TextInput y="60" width="220.5" id="flexTxt" fontSize="12" color="#000000" fontWeight="bold" horizontalCenter="0" themeColor="#000000"/>
    <mx:Button y="93" label="Send to FLASH" click="communicateToFlash()" horizontalCenter="0" color="#000000" themeColor="#000000" id="submitBtn"/>
</mx:Application>