/ Published in: MXML

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:Script> <![CDATA[ import mx.rpc.events.ResultEvent; import mx.collections.ArrayCollection; [Bindable] private var ac:ArrayCollection = new ArrayCollection(); private var searchURL:String = "http://search.twitter.com/search.atom?q="; private function viewSearch( e:MouseEvent ):void { httpService.url = searchURL + textInput.text; httpService.send(); } private function onHttpServiceResultHandler( e:ResultEvent ):void { ac = e.result.feed.entry as ArrayCollection; } ]]> </mx:Script> <mx:HTTPService id="httpService" result="onHttpServiceResultHandler(event)" /> <mx:TextInput id="textInput" text="Adobe" width="387" top="10" left="10"/> <mx:Button label="Search" right="10" top="10" click="viewSearch(event)"/> <mx:List left="10" top="40" right="10" bottom="10" dataProvider="{ac}" labelField="title" /> </mx:Application>
URL: http://gotoandlearn.com/play?id=99
Comments
