atndのapiから取得したデータを表示させた。

by simultechnology
♥0 | Line 32 | Modified 2010-05-16 23:38:43 | MIT License
play

ActionScript3 source code

/**
 * Copyright simultechnology ( http://wonderfl.net/user/simultechnology )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/peUP
 */

<?xml version="1.0" encoding="utf-8"?>
<!--- 
外部XMLファイルを読むにあたって、「5iVESTAR.ORG」様のプロキシを使わせてもらいました。
Wonderfl が楽しい December 28th, 2008
http://5ivestar.org/blog/2008/12/wonderfl-webproxy/
-->
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
			   xmlns:s="library://ns.adobe.com/flex/spark" 
			   xmlns:mx="library://ns.adobe.com/flex/mx"
			   applicationComplete="init()">
	<fx:Script>
		<![CDATA[
			import mx.controls.Alert;
			import mx.events.FlexEvent;
			
			protected function init():void
			{
				Security.loadPolicyFile("http://5ivestar.org/proxy/crossdomain.xml");
				srv.send();
			}	
		]]>
	</fx:Script>
	<fx:Declarations>
		<s:HTTPService id="srv" url="http://5ivestar.org/proxy/http://api.atnd.org/events/?count=100" />
	</fx:Declarations>
	
	<mx:AdvancedDataGrid dataProvider="{srv.lastResult.hash.events.event}" height="465">
		<mx:columns>
			<mx:AdvancedDataGridColumn dataField="event-id" headerText="イベントID" width="65"/>
			<mx:AdvancedDataGridColumn dataField="title" headerText="タイトル" width="250"/>
			<mx:AdvancedDataGridColumn dataField="started-at" headerText="開始時間" width="150"/>
		</mx:columns>
	</mx:AdvancedDataGrid>
</s:Application>