Newer
Older
blogpod / blogpod.mxml
@reddawg reddawg on 29 Apr 2008 1 KB sync
<?xml version="1.0" encoding="utf-8"?>
<mx:Module xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="doInit()" width="600" height="500">
  <mx:Script>
  	<![CDATA[
  		import mx.controls.Alert;
		import mx.collections.*;
		import mx.events.ListEvent;
		import mx.events.FlexEvent;
		
		public var myPod:Object;
		
		public function doInit():void {
              doResize();
              //myPod.podWindow.setStyle("borderColor","#CC00FF");
              feedRequest.send();
              }
              
            public function doResize():void {
              this.width = this.parent.width - 30;
              this.height = this.parent.height - 30;
              }
          
            //http://weblogs.macromedia.com/mchotin/index.xml
  	]]>
  </mx:Script>
  

    <mx:HTTPService id="feedRequest" url="http://rss.cnn.com/rss/cnn_topstories.rss" useProxy="false" />


   <mx:Text text="{feedRequest.lastResult.rss.channel.title}"  width="100%"/>
        <mx:DataGrid id="dgPosts" dataProvider="{feedRequest.lastResult.rss.channel.item}" top="20" left="0" right="0" bottom="195">
            <mx:columns>
                <mx:DataGridColumn headerText="Posts" dataField="title"/>
                <mx:DataGridColumn headerText="Date" dataField="pubDate" width="150" />
            </mx:columns>
        </mx:DataGrid>

        <mx:LinkButton x="0" label="Read Full Post" click="navigateToURL(new URLRequest(dgPosts.selectedItem.link));" bottom="0"/>
    
        <mx:TextArea left="0" right="0" top="175" bottom="30" htmlText="{dgPosts.selectedItem.description}" />
        


</mx:Module>