<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml";
layout="absolute"
        creationComplete="init()"
        borderColor="#020000" backgroundGradientAlphas="[1.0, 1.0]"
backgroundGradientColors="[#BA2A2A, #020000]" width="950"
height="557">

<mx:Script>
     <![CDATA[
         import mx.rpc.events.ResultEvent;
         import mx.collections.ArrayCollection;
         [Bindable]
         public var datas:ArrayCollection;

        public function init():void
         {
          if(tech.enabled==true)
             {
             RSSFeedtech.send();
             }
          if(stories.enabled==true)
             {
             RSSFeedtop.send();
             }
        if(world.enabled==true)
             {
              RSSFeedworld.send();
             }
        if(terrorism.enabled==true)
             {
             RSSFeedterror.send();
             }
        if(sci.enabled==true)
             {
             RSSFeedsci.send();
             }
          }
        public function resultHandler(event:ResultEvent):void
         {
             datas = event.result.rss.channel.item;
         }
    ]]>
</mx:Script>

   <mx:HTTPService id="RSSFeedtech" url="http://rss.news.yahoo.com/rss/
tech"
   resultFormat="object" result= "resultHandler(event)"  />

   <mx:HTTPService id="RSSFeedtop" url="http://rss.news.yahoo.com/rss/
topstories"
   resultFormat="object" result= "resultHandler(event)"/>

   <mx:HTTPService id="RSSFeedworld" url="http://rss.news.yahoo.com/
rss/world"
   resultFormat="object" result= "resultHandler(event)"/>

   <mx:HTTPService id="RSSFeedterror" url="http://rss.news.yahoo.com/
rss/terrorism"
   resultFormat="object" result= "resultHandler(event)"/>

   <mx:HTTPService id="RSSFeedsci" url="http://rss.news.yahoo.com/rss/
science"
   resultFormat="object" result= "resultHandler(event)"/>


                <mx:TabNavigator x="26" y="19" width="896" height="527" >

                <mx:VBox label="Welcome" >
                        <mx:Canvas backgroundColor="#9B2B2B" width="895" 
height="496">
                <mx:Panel width="286" height="278" layout="absolute"  x="304.5"
y="103"   backgroundColor="#892828">
                    <mx:Label text="Wlcome to the yahoo news reader"  x="10" 
y="87"
fontFamily="Verdana" fontSize="13" fontWeight="bold"
fontStyle="italic" color="#BDF78E"/>
                  </mx:Panel>
                  </mx:Canvas>
                </mx:VBox>

                                <mx:VBox id="tech" label="Technology" 
click="true" >
                        <mx:Canvas backgroundColor="#9B2B2B" width="895" 
height="496">
                        <mx:DataGrid id="technews" dataProvider="{datas}" 
width="544"
height="260" themeColor="#F65353" borderColor="#060000"
alternatingItemColors="[#FEFEFE, #FADBDB]" y="10" x="175">
                              <mx:columns>
                                 <mx:DataGridColumn dataField="title" 
headerText="Title"
width="300"/>
                                 <mx:DataGridColumn dataField="pubDate"
headerText="Publication Date"/>
                              </mx:columns>
                        </mx:DataGrid>
                <mx:Panel width="286" height="278" layout="absolute" title="News
Description">
                                <mx:TextArea 
htmlText="{technews.selectedItem.description}" x="0"
y="0" width="302" height="160"/>
                        </mx:Panel>
                        </mx:Canvas>
                </mx:VBox>



                <mx:VBox id="stories" label="TopStories">
                    <mx:Canvas backgroundColor="#9B2B2B" width="895" 
height="496">
                        <mx:DataGrid id="topnews" dataProvider="{datas}" 
width="544"
height="260" themeColor="#F65353" borderColor="#060000"
alternatingItemColors="[#FEFEFE, #FADBDB]" y="10" x="176">
                          <mx:columns>
                                 <mx:DataGridColumn dataField="title" 
headerText="Title"
width="300"/>
                                 <mx:DataGridColumn dataField="pubDate"
headerText="Publication Date"/>
                              </mx:columns>
                        </mx:DataGrid>
                        <mx:Panel x="286" y="278" width="322" height="200"
layout="absolute" title="News Description">
                                <mx:TextArea 
htmlText="{topnews.selectedItem.description}" x="0"
y="0" width="302" height="160"/>
                        </mx:Panel>
                        </mx:Canvas>
                </mx:VBox>


                <mx:VBox id="world" label="World" >
                     <mx:Canvas backgroundColor="#9B2B2B" width="896" 
height="493">
                        <mx:DataGrid id="worldnews" dataProvider="{datas}" 
width="544"
height="260" themeColor="#F65353" borderColor="#060000"
alternatingItemColors="[#FEFEFE, #FADBDB]" y="10" x="175">

                              <mx:columns>
                                 <mx:DataGridColumn dataField="title" 
headerText="Title"
width="300"/>
                                 <mx:DataGridColumn dataField="pubDate"
headerText="Publication Date"/>
                              </mx:columns>
                        </mx:DataGrid>
                        <mx:Panel x="286" y="278" width="322" height="200"
layout="absolute" title="News Description">
                                <mx:TextArea 
htmlText="{worldnews.selectedItem.description}" x="0"
y="0" width="302" height="160"/>
                        </mx:Panel>
                        </mx:Canvas>
                </mx:VBox>


                <mx:VBox id="terrorism" label="Terrorism" >
                     <mx:Canvas backgroundColor="#9B2B2B" width="895" 
height="496">
                        <mx:DataGrid id="terrornews" dataProvider="{datas}" 
width="544"
height="260" themeColor="#F65353" borderColor="#060000"
alternatingItemColors="[#FEFEFE, #FADBDB]" y="10" x="175">

                              <mx:columns>
                                 <mx:DataGridColumn dataField="title" 
headerText="Title"
width="300"/>
                                 <mx:DataGridColumn dataField="pubDate"
headerText="Publication Date"/>
                              </mx:columns>
                        </mx:DataGrid>
                        <mx:Panel x="286" y="278" width="322" height="200"
layout="absolute" title="News Description">
                                <mx:TextArea 
htmlText="{terrornews.selectedItem.description}"
x="0" y="0" width="302" height="160"/>
                        </mx:Panel>
                        </mx:Canvas>
                </mx:VBox>


                <mx:VBox id="sci" label="Science">
                    <mx:Canvas backgroundColor="#9B2B2B" width="899" 
height="497">
                        <mx:DataGrid id="scinews" dataProvider="{datas}" 
width="544"
height="260" themeColor="#F65353" borderColor="#060000"
alternatingItemColors="[#FEFEFE, #FADBDB]" x="166" y="10">

                              <mx:columns>
                                 <mx:DataGridColumn dataField="title" 
headerText="Title"
width="300"/>
                                 <mx:DataGridColumn dataField="pubDate"
headerText="Publication Date"/>
                              </mx:columns>
                        </mx:DataGrid>
                        <mx:Panel x="286" y="278" width="322" height="200"
layout="absolute" title="News Description">
                                <mx:TextArea 
htmlText="{scinews.selectedItem.description}" x="0"
y="0" width="302" height="160"/>
                        </mx:Panel>
                        </mx:Canvas>
                </mx:VBox>

        </mx:TabNavigator>

</mx:WindowedApplication>





i am getting the output but the thing is that only "science news"(last
news) gets displayed

i think the prob is with "if statement"

help me

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to