adding twitter event handler example
This commit is contained in:
parent
af1a62c760
commit
428f98d5b7
22
03b-handling-events/TwitterTimeline.mxml
Normal file
22
03b-handling-events/TwitterTimeline.mxml
Normal file
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
|
||||
width="500" height="500">
|
||||
<mx:HTTPService
|
||||
id="twitterService"
|
||||
url="http://twitter.com/statuses/public_timeline.xml"
|
||||
resultFormat="e4x"
|
||||
result="twitterServiceResultHandler(event);"
|
||||
/>
|
||||
<mx:Script>
|
||||
<![CDATA[
|
||||
import mx.rpc.events.ResultEvent;
|
||||
private function twitterServiceResultHandler(event:ResultEvent):void
|
||||
{
|
||||
resultTxt.text = event.result.toString();
|
||||
}
|
||||
]]>
|
||||
</mx:Script>
|
||||
<mx:Button id="myButton" label="Send HTTP Request"
|
||||
click="twitterService.send()"/>
|
||||
<mx:TextArea id="resultTxt" width="100%" height="100%"/>
|
||||
</mx:Application>
|
Loading…
Reference in New Issue
Block a user