How to parse RSS Feed - Different URL for each button

I'm making an app with AS3 and I want to be able to load a different RSS Feed when the user clicks on each button. This is the code I have so far, has anyone any idea how I can modify my code to do this?
here's my code so far:
//IMPORT CLASSES
import fl.controls.List;
import flash.net.URLLoader;
import flash.events.Event;
import flash.net.URLRequest;
cGOSSIP.addEventListener(MouseEvent.CLICK, doClick);
function doClick (e:MouseEvent):void
cGOSSIP.gotoAndStop ("GOSSIP"); 
wNEWS.addEventListener(MouseEvent.CLICK, doClick2);
function doClick2 (e: MouseEvent):void
          wNEWS.gotoAndStop ("WORLD NEWS");
eNEWS.addEventListener(MouseEvent.CLICK, doClick3);
function doClick3 (e: MouseEvent):void
          eNEWS.gotoAndStop ("ENT NEWS");
fbNEWS.addEventListener(MouseEvent.CLICK, doClick4);
function doClick4 (e: MouseEvent):void
          fbNEWS.gotoAndStop ("FB NEWS");
//NEWSLIST FORMATTING
var newsListTf:TextFormat = new TextFormat();
newsListTf.font = "Verdana";
newsListTf.color = 0xFFFFFF;
newsListTf.size = 18;
newsListTf.align = "left";
newsList.setRendererStyle("textFormat", newsListTf);
newsList.rowHeight = 100;
newsList.allowMultipleSelection = false;
//newsList.wordWrap = true;
//NEWSDISPLAY TEXT AREA FORMATTING
var rssStoryTf:TextFormat = new TextFormat();
rssStoryTf.font = "Verdana";
rssStoryTf.color = 0x6699CC;
rssStoryTf.size = 22;
rssStoryTf.align = "left";
rssStory.setStyle("textFormat", rssStoryTf);
//READMORE BUTTON FORMATTING
var buttonTf:TextFormat = new TextFormat();
buttonTf.font = "Verdana";
buttonTf.color = 0xFFFFFF;
buttonTf.size = 22;
btn_ReadMore.setStyle("textFormat", buttonTf);
//RSS FEED
var rssLoader:URLLoader = new URLLoader();
var rssURL:URLRequest = new URLRequest
("http://rssfeeds.tv.adobe.com/adobe-higher-education-solutions.xml");
rssLoader.addEventListener(Event.COMPLETE, rssLoaded);
newsList.addEventListener(Event.CHANGE, selectRssStory);
btn_ReadMore.addEventListener(MouseEvent.CLICK, goToURL);
rssLoader.load(rssURL);
var newsXML:XML = new XML();
var currentStoryURL:URLRequest = new URLRequest();
newsXML.ignoreWhitespace = true;
function rssLoaded(evt:Event):void
newsXML = new XML(rssLoader.data);
//trace(newsXML);
for(var item:String in newsXML.channel.item) {
//newsList.addItem({label: newsXML.channel.item[item].pubDate.substr(0, 16)
//+": " + newsXML.channel.item[item].title } );
newsList.addItem({label: newsXML.channel.item[item].title.substr(0, 40)
+" ..." } );
newsList.selectedIndex = 0;
//FIRST LOAD
currentStoryURL = new URLRequest(newsXML.channel.item[0].link);
rssStory.htmlText = newsXML.channel.item[0].description;
function selectRssStory(evt:Event):void
rssStory.htmlText = newsXML.channel.item[evt.target.selectedIndex ].description;
currentStoryURL = new URLRequest(newsXML.channel.item[evt.target.selectedIndex
].link);
function goToURL(event:MouseEvent):void
navigateToURL(currentStoryURL);

I copied the wrong code, it works and loads the feed but I have a number of buttons in the main menu and I want to be able to load a different rss feed for each button?
Here's the code.
btn_Home.addEventListener(MouseEvent.CLICK, clickHome);
function clickHome(e:MouseEvent):void
          gotoAndStop ("START");
//NEWSLIST FORMATTING
var newsListTf:TextFormat = new TextFormat();
newsListTf.font = "Verdana";
newsListTf.color = 339999;
newsListTf.size = 18;
newsListTf.align = "left";
newsList.setRendererStyle("textFormat", newsListTf);
newsList.rowHeight = 100;
newsList.allowMultipleSelection = false;
//newsList.wordWrap = true;
//NEWSDISPLAY TEXT AREA FORMATTING
var rssStoryTf:TextFormat = new TextFormat();
rssStoryTf.font = "Verdana";
rssStoryTf.color = 0x6699CC;
rssStoryTf.size = 22;
rssStoryTf.align = "left";
rssStory.setStyle("textFormat", rssStoryTf);
//READMORE BUTTON FORMATTING
var buttonTf:TextFormat = new TextFormat();
buttonTf.font = "Verdana";
buttonTf.color = 0xFFFFFF;
buttonTf.size = 22
btn_ReadMore.setStyle("textFormat", buttonTf);
//RSS FEED
var rssLoader:URLLoader = new URLLoader();
var rssURL:URLRequest = new URLRequest
("http://www.tmz.com/rss.xml");
rssLoader.addEventListener(Event.COMPLETE, rssLoaded);
newsList.addEventListener(Event.CHANGE, selectRssStory);
btn_ReadMore.addEventListener(MouseEvent.CLICK, goToURL);
rssLoader.load(rssURL);
var newsXML:XML = new XML();
var currentStoryURL:URLRequest = new URLRequest();
newsXML.ignoreWhitespace = true;
function rssLoaded(evt:Event):void
newsXML = new XML(rssLoader.data);
//trace(newsXML);
for(var item:String in newsXML.channel.item) {
//newsList.addItem({label: newsXML.channel.item[item].pubDate.substr(0, 16)
//+": " + newsXML.channel.item[item].title } );
newsList.addItem({label: newsXML.channel.item[item].title.substr(0, 40)
+" ..." } );
newsList.selectedIndex = 0;
//FIRST LOAD
currentStoryURL = new URLRequest(newsXML.channel.item[0].link);
rssStory.htmlText = newsXML.channel.item[0].description;
function selectRssStory(evt:Event):void
rssStory.htmlText = newsXML.channel.item[evt.target.selectedIndex ].description;
currentStoryURL = new URLRequest(newsXML.channel.item[evt.target.selectedIndex
].link);
function goToURL(event:MouseEvent):void
navigateToURL(currentStoryURL);

Similar Messages

  • Adding a different url to each button

    Flash menu
    I'm really struggling to work out how to add a different URL
    to each of my buttons. See the attached. Any help
    appreciated.

    click on each of the menu clips and open up the actions
    panel, all the actions for the buttons are stored there. see
    LINK
    and test.

  • How to set different urls for logoff button for different user groups

    HI All,
    We have two different set of users in our company .when one user group clicks on the logoff button in masthead we want to redirect them to for example www.google.com and for the other group we want to redirect to www.gmail.com.
    How can we acheive this particular requirement
    Thanks
    Bala Duvvuri

    hi bala,
    For the  two user groups maintain two different desktops, two/same themes and frame work.change the headeriview jsp in masthead par file to Google and save it as masthead1 and another one with gmail as masthead2 then create iviews with that par file and assign them to different groups and make invisible the default masthead iview.then the users get the logoff based on group you can get some wikis on changing log off or redirecting log off, check these threads
    Portal logoff : Redirection or Close the Entire Window
    Portal Logoff redirection URL
    Regards
    Mahesh

  • I have multiple emails, how do I add different signatures for each email address

    I have multiple emails for different companies I work for, how do I add a different signature for each one, it seems like I have to use the same one for all of them

    Thanks.  I think I'm on the right track.  I added the email address to my contacts and double clicked the image icon to change it, but it only lets me snap a new picture or select an image from another location.  What is the folder location of the stock icons that come with Mac OSX?

  • HT201320 Need different sound for each email account

    How can I setup a different sound for each email account incoming emails?

    Tell Apple you'd like to see this feature...you're not the first:
    http://www.apple.com/feedback/iphone.html

  • I have 3 iphones, an ipod touch and an Ipad on the same itunes account.  should I have a different account for each device?  If so how do I get all my purchases, like music on all the devices?

    I have 3 iphones, an ipod touch and an Ipad on the same itunes account.  should I have a different account for each device?  If so how do I get all my purchases, like music on all the devices?

    You can sync as many devices as you want to the same iTunes account, there is no limit. You can have the same content on each device or different content, the choice is yours. iTunes will keep everything straight, by device, including separate backups. I'd suggest giving each device a unique name, to make things easier.

  • How can i upload two different logos for 2 sub sites [which falls under one super site ] in share point 2013 ?

    hello,
    How can i upload two different logos for 2 sub sites [which falls under one super site ] in share point 2013 ?
    thanks,
    Jay

    Hi,
    I understand that it applied first logo to all other sub sites.
    Please make sure that you change the logos in the subsites.
    If we change the logo in the root site, the logos in the subsites will be changed at the same time.
    However, we can change the logo in the subsites separately.
    We can go to a subsite, click the Site Sitting-> Look and Feel-> Title, description, and logo->Insert Logo->select a picture, then it will has a different logo than the root site.
    Then go to the other subsite, click the Site Sitting-> Look and Feel-> Title, description, and logo->Insert Logo-> select another picture, then it will has a different logo that the first subsite.
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • How to use the different class for each screen as well as function.

    Hi Experts,
    How to use the different class for each screen as well as function.
    With BestRegards,
    M.Thippa Reddy.

    Hi ThippaReddy,
    see this sample code
    Public Class ClsMenInBlack
    #Region "Declarations"
        'Class objects
        'UI and Di objects
        Dim objForm As SAPbouiCOM.Form
        'Variables
        Dim strQuery As String
    #End Region
    #Region "Methods"
        Private Function GeRate() As Double
                Return Double
        End Function
    #End Region
    Public Sub SBO_Appln_MenuEvent(ByRef pVal As SAPbouiCOM.MenuEvent, ByRef BubbleEvent As Boolean)
            If pVal.BeforeAction = True Then
                If pVal.MenuUID = "ENV_Menu_MIB" Then
                End If
            Else ' Before Action False
                End If
        End Sub
    #End Region
    End Class
    End Class
    Rgds
    Micheal
    Vasu Anna Regional Feeling a???? Just Kidding
    Edited by: micheal willis on Jul 27, 2009 5:49 PM
    Edited by: micheal willis on Jul 27, 2009 5:50 PM

  • How to configure different listener for each database in 11gR2 RAC

    Hi Friends,
    Current Prod Setup :
    11gR2 (11.2..0.2) RAC on RHEL 5.5 with 3 SCAN Listeners on default 1521 port.
    Having 4 databases which are using SCAN-IP and listening on default port only.
    As per policy, we have to create separate listeners (on different port) for each database.
    like,
    DB1 - 1522
    DB2 - 1523
    DB3 - 1524
    DB4 - 1525
    Even If I configure 4 listeners using NETCA, how my failover & load balancing will happen using SCAN & Newly Created Listeners ???
    Thanks in advance..
    Regards,
    Manish

    Hi,
    I tried on 11gR2 TEST RAC Server to have different listener with different port (1529) for SCAN & Node Listener & tested failover, load-balancing which was successful.
    [oracle@ravish5 admin]$ cat listener.ora
    LISTENER_A=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_A)))) # line added by Agent
    ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_A=ON # line added by Agent
    [oracle@ravish5 admin]$ ps -ef | grep lsnr
    oracle 1985 1 0 00:46 ? 00:00:00 /11g_crs/11.2.0.2/product/home/bin/tnslsnr LISTENER -inherit
    oracle 1988 1 0 00:46 ? 00:00:00 /11g_database/11.2.0.2/product/home_1/bin/tnslsnr LISTENER_A -inherit
    oracle 2928 1 0 01:00 ? 00:00:00 /11g_crs/11.2.0.2/product/home/bin/tnslsnr LISTENER_SCAN1 -inherit
    [oracle@ravish5 admin]$ lsnrctl status LISTENER_A
    LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 02-MAY-2012 03:19:35
    Copyright (c) 1991, 2010, Oracle. All rights reserved.
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_A)))
    STATUS of the LISTENER
    Alias LISTENER_A
    Version TNSLSNR for Linux: Version 11.2.0.2.0 - Production
    Start Date 02-MAY-2012 00:46:42
    Uptime 0 days 2 hr. 32 min. 54 sec
    Trace Level off
    Security ON: Local OS Authentication
    SNMP OFF
    Listener Parameter File /11g_database/11.2.0.2/product/home_1/network/admin/listener.ora
    Listener Log File /11g_database/11.2.0.2/diag/tnslsnr/ravish5/listener_a/alert/log.xml
    Listening Endpoints Summary...
    (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_A)))
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.3.5)(PORT=1529)))
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.3.16)(PORT=1529)))
    Services Summary...
    Service "TEST" has 1 instance(s).
    Instance "TEST2", status READY, has 1 handler(s) for this service...
    Service "TESTXDB" has 1 instance(s).
    Instance "TEST2", status READY, has 1 handler(s) for this service...
    Service "srvc_test.clover.com" has 1 instance(s).
    Instance "TEST2", status READY, has 1 handler(s) for this service...
    The command completed successfully
    SQL> show parameter listen
    NAME TYPE VALUE
    listener_networks string
    local_listener string (DESCRIPTION=(ADDRESS_LIST=(AD
    DRESS=(PROTOCOL=TCP)(HOST=192.
    168.3.16)(PORT=1529))))
    remote_listener string ravish-scan:1529
    SQL> exit
    Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
    Data Mining and Real Application Testing options
    [oracle@ravish5 admin]$ srvctl config scan_listener
    SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521,1529
    [oracle@ravish5 admin]$ srvctl config scan
    SCAN name: ravish-scan, Network: 1/192.168.3.0/255.255.255.0/eth0
    SCAN VIP name: scan1, IP: /ravish-scan.clover.com/192.168.3.22
    [oracle@ravish5 admin]$ srvctl config listener
    Name: LISTENER
    Network: 1, Owner: oracle
    Home: <CRS home>
    End points: TCP:1521
    Name: LISTENER_A
    Network: 1, Owner: oracle
    Home: /11g_database/11.2.0.2/product/home_1
    End points: TCP:1529
    [oracle@ravish5 admin]$ srvctl config service -d TEST -s srvc_test.clover.com
    Service name: srvc_test.clover.com
    Service is enabled
    Server pool: TEST_srvc_test.clover.com
    Cardinality: 2
    Disconnect: false
    Service role: PRIMARY
    Management policy: AUTOMATIC
    DTP transaction: false
    AQ HA notifications: true
    Failover type: SELECT
    Failover method: BASIC
    TAF failover retries: 0
    TAF failover delay: 0
    Connection Load Balancing Goal: LONG
    Runtime Load Balancing Goal: NONE
    TAF policy specification: BASIC
    Edition:
    Preferred instances: TEST1,TEST2
    Available instances:
    TEST_NEW =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = ravish-scan.clover.com)(PORT = 1529))
    (LOAD_BALANCE = yes)
    (FAILOVER = ON)
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = srvc_test.clover.com)
    (FAILOVER_MODE =
    (TYPE = SELECT)
    (METHOD = BASIC)
    Actually different ports for different databases are required to have separation of duties. Once Firewall enabled betwen Client & DB Server only privileged users would have access to particular database.
    Regards,
    Manish

  • How to set up different realms for each server ?

    I am using weblogic 6 sp1.I have a domain with several servers. i want to assoicate or use different custom security realm for each server.However -on weblogic console- there is no 'Target' tab in the Security node ,and no way to set up multiple Security nodes.How ca i do this (or can i)?

    Main reason why is this:
    Imagine situation I have 2 servers A and B both of them bellongs to domain SomeDomain.
    Server A is as WebServer and server B hosts all EJBs. And server A is outside
    firewall (does not have DB access). But i would like to use RDBMS realm so what
    to do in this situation. Place both servers in different domains and in server
    A install proxy realm for RDBS realm ?
    "Tom Moreau" <[email protected]> wrote:
    >
    You can't have a different realm for each
    server. There is only one realm for all
    servers - think of it as there is only
    one set of authentication & authorization
    information (that is users/groups/permissions)
    and it applies to all servers.
    Why do you want each server to have its
    own realm? If someone tries to log in,
    do you want WLS to automatically route
    them to a server who is capable of logging
    them in? I'm having trouble understanding
    why you want this feature.
    Thanks,
    -Tom Moreau
    Rachel <[email protected]> wrote:
    I am using weblogic 6 sp1.I have a domain with several servers. i want
    to assoicate or use different custom security realm for each server.However
    -on weblogic console- there is no 'Target' tab in the Security node
    ,and no way to set up multiple Security nodes.How ca i do this (or can
    i)?

  • Qry:How to get different price for each price list (variable area) in order

    1-How to get different price for each price list (variable area) in order for sale. for the opportunity to display and select multiple prices.
    2- I add a location store from a table in line item and I want to see this area in order,.
    I 'm created 2 field location(item line and order), 1 table location
    I tried this for exemple : select $ [userfieldlocation.OITW]

    Thanks Suda for your answer,
    the Formatted Search for prices is OK, but for the Item locations in warehouse this is not so simple,     
    I must have several (at least 2) locations for the item in the Warehouse and a track of this location and search possibilities.
    read carefully and imagine how (Management warehouse locations)
    I added a user table '@Location' who linked to a user field 'U_Location in Item master data --> lnventory data  line and an ather user field 'U_Location' in sales order
    I met the value of location in the table (list of locations for any warehouse), I select the location of each item while receiving merchandise in the user field of inventory data line (Item M data) and this value appears in the sales order 'U_Location' user field ( only the location value in the default warehouse for this Item)
    or
    create an user field 'location' in Good receipt PO to fill it while receiving merchandise that appears in the sales order to give possibility to find/select the location of the item at this order and in Item master data
    I think we will use all these tables
    @LOCATION
    PDN1
    OITM
    OITW
    OWHS
    RDR1
    Juste a another question : where you found this and What is: ' 38.1.0 '
    Is it in document (System information):Item=38 Pane=1 ??
    Thanks,
    Ouchen

  • How can i apply different color for each cell in jlist component?

    hi guys i need your help and sorry if my english is very bad..guys how can i apply different colors for each cell in jlist component? for example for the first cell i want to apply color blue, for the second cell i want red, etc... i need your answer guys tnx..
    Edited by: ryrene on Mar 21, 2010 12:13 AM

    ryrene wrote:
    hi guys i need your help and sorry if my english is very bad.
    ..guys how can i apply different colors for each cell in jlist component? for example for the first cell i want to apply color blue, for the second cell i want red, etc... i need your answer guys tnx..I'll see your tnx, and raise you dve bmbrs & nplm.

  • How to append parameter with URL for each record in table control?

    Hi,
    I have one table control which contains 5 columns.
    (tripno, startdate, destination, reason, activities)
    In 5th column, i need to display URL for each record.
    for ex:
    www.abc.com/test?tripno=1
    www.abc.com/test?tripno=2
    www.abc.com/test?tripno=3
    when user clicks a particular hyperlink, it navigates to another page/component thru URL with one key field(tripno) to retrieve related records in next page.
    1) i am not able to assign tripno to each record. when i assign tripno, its taking the last value which i assigned. ie. tripno=3 only.
    How to assign URL to Reference field of LINK_TO_URL element at run time?
    OR
    2) we can do like this.
    Simply assign url to reach record without key field.
    www.abc.com/test
    www.abc.com/test
    www.abc.com/test
    when user clicks a particular link, we can assign corresponding key field to the URL.
    Where should i write this event? Bcoz, LINK_TO_URL doesnot have event.
    how to do?

    Hi MOg.
    Not sure whether I understand you .. but in the 5th column you want to have the reference URL. Is this the activities columen from you example?
    Nevertheless, you need a attribute (String) in your context node which contains the URL. Bind this to the reference filed of linktourl. If you can not extend the structure you can create a sub node (cardinality 1:1)  which contains the refernce attribute.
    Then loop over all elements and concatenate www.abc.com/test?tripno= with the tripno of the current element into the reference field.
    Hope tis helps,
    Sascha.
    Bind the

  • In Cover Flow, a compilation album shows different covers for each song.  How do I make it show one cover for the whole album?

    In Cover Flow, a compilation album shows different covers for each song.  How do I make it show one cover for the whole album?

    Also in the first page of Get Info for all tracks set the Album Artist to be Various Artists.
    If you select all the tracks and right click to get info then you can do all the tracks in one go

  • How to acquire from various AI channels simultaneously with a different range for each one?

    How to acquire from various AI channels simultaneously with a different range for each one?
    In LabView I have found some examples but in C there isn't seem to be any.
    Solved!
    Go to Solution.

    Or you can add channels one by one with individual instructions: the follwing code compile and runs with no errors on a vitual daq device:
    err = DAQmxCreateTask ("", &taskH);
    err = DAQmxCreateAIVoltageChan (taskH, "Dev1/ai0", "AI0", DAQmx_Val_Cfg_Default, -5.0, 5.0, DAQmx_Val_Volts, "");
    err = DAQmxCreateAIVoltageChan (taskH, "Dev1/ai1", "AI1", DAQmx_Val_Cfg_Default, -10.0, 10.0, DAQmx_Val_Volts, "");
    DAQmxStartTask (taskH);
    err = DAQmxReadAnalogF64 (taskH, 5, 10.0, DAQmx_Val_GroupByChannel, val, 10, &read, 0);
    DAQmxClearTask (taskH);
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

Maybe you are looking for

  • IPhone now only vibrating a few times?

    When I got a phone call, my iPhone 5 would vibrate until the call went to voicemail, or until I hit the lock button. Now it seems it is vibrating only a few times (I want to say four times) until it just stops vibrating - but the call is still going.

  • Oracle 8i lite and palm pilots

    So has Anyone been able to get Oracle 8i Lite to work with a Palm Pilot? I've been browing through some of the forums on 8i Lite and some form apps like Satellite Forms and it doesn't seem like anyone has had much success.

  • Certificates with a Question Mark

    There are certificates on my BB with a question mark next to them instead of a check mark.  What does this mean, and how do I change it to a check mark?

  • Urgently required QM Docs

    Hi Experts, Can anybody provide the SAP QM docs, for which i can be verym much grateful to you all. Rakesh.

  • Question Choice: A, B, C

    Is there any way to instruct Presenter not to label question choices as A), B), C)? I see options for a), b), c) and 1), 2), 3) KC