flex3.5インストールしました。
○flex3.5ダウンロードサイト
http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+3
○Data Visualizationコンポーネント
http://www.adobe.com/cfusion/entitlement/index.cfm?e=flex3sdk
○Data Visualizationコンポーネントのインストール手順
※3.3時のインストールですが、手順は同様です。
http://www.noridon.net/weblogs/archives/flex/flex3/
3.5バージョンで、
preloader のローディング中にクリックすると、
SystemManager でエラーが出るバグがfixされました。
○as3syndicationlib
rssフィードをパースしてくれるライブラリ。
RSS1.0、RSS2.0、ATOM1.0など対応。
http://code.google.com/p/as3syndicationlib/
簡単なサンプル作成しました。
<?xml version=”1.0″ encoding=”utf-8″?>
<mx:Application
xmlns:mx=”http://www.adobe.com/2006/mxml”
layout=”absolute” initialize=”init();”>
<mx:Script>
<![CDATA[
import com.adobe.xml.syndication.generic.IItem;
import com.adobe.xml.syndication.generic.IFeed;
import com.adobe.xml.syndication.generic.FeedFactory;
private function init():void
{
var loader:URLLoader = new URLLoader();
var request:URLRequest = new URLRequest("http://maxfactory.biz/blog/feed/");
loader.addEventListener(Event.COMPLETE, loadCompleteHandler);
loader.load( request );
}
private function loadCompleteHandler(e:Event):void
{
var rssString:String = URLLoader(e.target).data;
var feed:IFeed = FeedFactory.getFeedByString(rssString);
for (var i:uint=0; i<feed.items.length; i++)
{
var item:IItem = feed.items[i] as IItem;
trace( “title = ” + item.title ); //タイトル
trace( “link = ” + item.link ); //リンク
trace( “date = ” + item.date ); //日付
trace( “excerpt.value = ” + item.excerpt.value ); //記事内容(抜粋)
}
}
]]>
</mx:Script>
</mx:Application>
サンプルでは、このブログのRSS Feedを読み込んで、
記事のタイトル、日付などの情報をtraceしてます。
Feedのtype(RSS1.0、RSS2.0、ATOM1.0)を意識しないで、parseできるからいいです。