TitiVb
%Europe/Berlin %632 %2006, 15:10
Hoi,
ik probeer een rss reader te maken waarvoor ik een rss doorgeef en dan weergeef in een list.
Maar dit lukt mij (nog) niet. Iemand Suggesties?
Dit is de code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" themeColor="haloOrange">
<mx:HTTPService url="{getRss()}" id="myHTTPData" useProxy="false"/>
<mx:Script>
<![CDATA[
import mx.controls.*;
import mx.rpc.http.HTTPService;
var myURL:String="http://www.zattevrienden.be/taxonomy/term/81/0/feed";
private function rssinput(input):void
{
setRss(input);
Alert.show(getRss());
reinitializeRss(input);
}
private function getRss():String
{
return myURL;
}
private function setRss(input):void
{
myURL = input;
}
private function reinitializeRss(input):void
{
myHTTPData.cancel();
myHTTPData.send();
}
]]>
</mx:Script>
<mx:Panel x="162" y="10" width="700" height="517" layout="absolute" title="RSS Reader">
<mx:Label x="10" y="10" text="{myHTTPData.lastResult.rss.channel.title}" fontFamily="Verdana" fontSize="18" color="#004080"/>
<mx:DataGrid x="372" y="46" id="dgPosts" width="298" dataProvider="{myHTTPData.lastResult.rss.channel.item}" height="288" color="#004080" fontFamily="Verdana" fontSize="13" fontWeight="bold">
<mx:columns>
<mx:DataGridColumn headerText="Posts" dataField="title" />
</mx:columns>
</mx:DataGrid>
<mx:TextArea width="354" htmlText="{dgPosts.selectedItem.description}" height="288" color="#004080" fontSize="13" fontFamily="Verdana" fontWeight="bold" x="10" y="46" editable="false"/>
<mx:LinkButton label="Volledige post lezen" click="navigateToURL(new URLRequest(dgPosts.selectedItem.link));" color="#004080" fontSize="16" fontFamily="Verdana" textAlign="left" x="10" y="342"/>
<mx:Button x="10" y="445" label="Verzenden" click="rssinput(input.text)"/>
<mx:TextInput x="10" y="415" id="input" width="354"/>
<mx:Button x="560" y="10" label="Standaard RSS" click="reinitializeRss()"/>
<mx:Label x="10" y="383" text="Nieuwe Rss initializeren" fontSize="16" color="#0080c0" fontWeight="bold"/>
</mx:Panel>
</mx:Application>
ik probeer een rss reader te maken waarvoor ik een rss doorgeef en dan weergeef in een list.
Maar dit lukt mij (nog) niet. Iemand Suggesties?
Dit is de code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" themeColor="haloOrange">
<mx:HTTPService url="{getRss()}" id="myHTTPData" useProxy="false"/>
<mx:Script>
<![CDATA[
import mx.controls.*;
import mx.rpc.http.HTTPService;
var myURL:String="http://www.zattevrienden.be/taxonomy/term/81/0/feed";
private function rssinput(input):void
{
setRss(input);
Alert.show(getRss());
reinitializeRss(input);
}
private function getRss():String
{
return myURL;
}
private function setRss(input):void
{
myURL = input;
}
private function reinitializeRss(input):void
{
myHTTPData.cancel();
myHTTPData.send();
}
]]>
</mx:Script>
<mx:Panel x="162" y="10" width="700" height="517" layout="absolute" title="RSS Reader">
<mx:Label x="10" y="10" text="{myHTTPData.lastResult.rss.channel.title}" fontFamily="Verdana" fontSize="18" color="#004080"/>
<mx:DataGrid x="372" y="46" id="dgPosts" width="298" dataProvider="{myHTTPData.lastResult.rss.channel.item}" height="288" color="#004080" fontFamily="Verdana" fontSize="13" fontWeight="bold">
<mx:columns>
<mx:DataGridColumn headerText="Posts" dataField="title" />
</mx:columns>
</mx:DataGrid>
<mx:TextArea width="354" htmlText="{dgPosts.selectedItem.description}" height="288" color="#004080" fontSize="13" fontFamily="Verdana" fontWeight="bold" x="10" y="46" editable="false"/>
<mx:LinkButton label="Volledige post lezen" click="navigateToURL(new URLRequest(dgPosts.selectedItem.link));" color="#004080" fontSize="16" fontFamily="Verdana" textAlign="left" x="10" y="342"/>
<mx:Button x="10" y="445" label="Verzenden" click="rssinput(input.text)"/>
<mx:TextInput x="10" y="415" id="input" width="354"/>
<mx:Button x="560" y="10" label="Standaard RSS" click="reinitializeRss()"/>
<mx:Label x="10" y="383" text="Nieuwe Rss initializeren" fontSize="16" color="#0080c0" fontWeight="bold"/>
</mx:Panel>
</mx:Application>