Linking to specific page in rss feed in flex 4.6



In flex 4.6 i'm showing an rss feed of giantbomb. I'm filling up a datagrid with this information but I want to link each item to his specific page. I created a function for it but when I click nothing is happening. What i'm a doing wrong?



<?xml version="1.0" encoding="utf-8"?>
<mx:ViewStack xmlns:fx="http://ift.tt/rYUnH9"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
width="100%" height="99%"
backgroundColor="#e9e9e9" contentBackgroundColor="#e9e9e9"
paddingTop="25" >
<fx:Script>
<![CDATA[
public function openRssAt(index:int):void {
var url:String = rssFeed.lastResult.rss.channel.item.link;

navigateToURL(new URLRequest(url), "_blank");
}
]]>
</fx:Script>
<fx:Declarations>
<s:HTTPService
showBusyCursor="true" id="rssFeed" resultFormat="object"
url="http://ift.tt/1m9CIQW"/>
<s:HTTPService
showBusyCursor="true" id="rssFeed2" resultFormat="object"
url="http://ift.tt/1ktgCOm"/>

</fx:Declarations>
<!-- MASTER -->
<s:NavigatorContent width="100%" height="100%">
<s:ButtonBar x="154" y="351"/>
<mx:TabNavigator x="0" y="-88" width="302" height="45">
<s:NavigatorContent width="100%" height="100%" label="New releases">

<s:DataGrid width="100%" height="100%" id="rssfeed" gridClick="openRssAt(event.rowIndex)"
dataProvider="{rssFeed.lastResult.rss.channel.item}"
creationComplete="rssFeed.send()">
<s:columns>
<s:ArrayList>

<s:GridColumn dataField="title" headerText="Titel"/>

</s:ArrayList>
</s:columns>
</s:DataGrid>

</s:NavigatorContent>
<s:NavigatorContent width="100%" height="100%" label="News">



<s:DataGrid width="100%" height="100%" id="rssfeed2" gridClick="openRssAt(event.rowIndex)"
dataProvider="{rssFeed2.lastResult.rss.channel.item}"
creationComplete="rssFeed2.send()">
<s:columns>
<s:ArrayList>

<s:GridColumn dataField="title" headerText="Titel"/>

</s:ArrayList>
</s:columns>
</s:DataGrid>


</s:NavigatorContent>
</mx:TabNavigator>
</s:NavigatorContent>
</mx:ViewStack>

No comments:

Post a Comment