本文主要是介绍初试Flex,一个小小的RSS阅读器!,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="800" height="600" fontSize="12" creationComplete="rssRequest.send()">
<mx:HTTPService
id="rssRequest"
url="http://rss.sina.com.cn/news/allnews/tech.xml"
useProxy="false" />
<mx:Script>
<![CDATA[
import flash.net.navigateToURL;
]]>
</mx:Script>
<mx:Panel width="100%" height="100%" layout="absolute" horizontalCenter="0" top="10" title="{rssRequest.lastResult.rss.channel.title}">
<mx:DataGrid horizontalCenter="0" width="760" y="10" height="434" id="rssgrid" dataProvider="{rssRequest.lastResult.rss.channel.item}">
<mx:columns>
<mx:DataGridColumn headerText="标题" dataField="title"/>
<mx:DataGridColumn headerText="内容" dataField="description"/>
<mx:DataGridColumn headerText="发布时间" dataField="pubDate"/>
<mx:DataGridColumn headerText="查看详细信息">
<mx:itemRenderer>
<mx:Component>
<mx:Button label="查看详细信息" click="navigateToURL(new URLRequest(data.link));" />
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
</mx:columns>
</mx:DataGrid>
</mx:Panel>
</mx:Application>
很简单,希望大家不要见笑。
为了查看相信费了不少的力气,开始打算用selectindex到,感觉不太舒服,发现了data这个好东西,data是一个内置对象,代表当前使用的数据,这样就方便多了。
这篇关于初试Flex,一个小小的RSS阅读器!的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!