<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" height="185" width="306" creationComplete="init()" viewSourceURL="srcview/index.html">
    <mx:Script>
        <![CDATA[
            import mx.rpc.events.ResultEvent;
            
            [Bindable]
            private var veryVeryRelatedKeyword:String = "";
            
            private function findVeryRelatedKeyord(e:MouseEvent):void{
                veryRelatedService.url = "http://www.veryrelated.com/related-api-v1.php?key=sampleapikey&results=1&base=" + searchKeyword.text;
                veryRelatedService.send();
            }
            
            private function onResult(e:ResultEvent):void{
                veryVeryRelatedKeyword =  e.result.ResultSet.Result.Text;
            }
        ]]>
    </mx:Script>
    <mx:TextInput id="searchKeyword" x="10" y="10" width="217"/>
    <mx:Button label="Find" click="findVeryRelatedKeyord(event)" id="searchButton" width="61" x="235" y="10"/>
    <mx:HTTPService result="onResult(event)" id="veryRelatedService" />
    <mx:Label x="10" y="42" text="Is Very VeryRelated to:" fontSize="20" color="#000000" fontWeight="bold"/>
    <mx:Text x="74" y="86" text="{veryVeryRelatedKeyword}" width="153" id="veryRelatedKeyword" fontSize="22" textAlign="left"/>
    
</mx:Application>