Skip to main content
Known Participant
November 24, 2009
Answered

Incorporating a live CNN news headline tracker - RSS

  • November 24, 2009
  • 2 replies
  • 3173 views

Hello.  I have a client who wants a live CNN headline ticker on their website.  This would be easy if it were an HTML based website, but this one is a Flash based website.  In looking around I've learned that you can use javascript or PHP to do this ... does anybody know which would be the most simple solution to create a really simple live news headline ticker?  Basically I have never done anything like this and have no idea how to go about it ... woould I use a component?

What might the AS3 code look like to do something like this?

Thanks very much.

This topic has been closed for replies.
Correct answer kglad

Good catch.  It's kind of starting to work.  It turns out some kind of filter here at work was blocking this from working on our server.  I moved it over to my own host's server it it's working.  I tried to bring it into a dynamic text box that uses the UIScrollBar component and that's not working for some reason.  Also, is there a way to filter out the technical symbols from the XML?

Here's the link: http://www.savagepixels.com/cnn/cnnTest.html

Thanks kglad!


well, normally you don't display xml in a textfield.  normally, you parse the xml and display the data you want and display it in a way that suits your app.

but, if you just want to dump the entire xml into a textfield, you could html-enable your textfield and assign its htmlText to the xml.  i think that will strip all the tags.  it will probably leave cdata nodes that you'll need to strip with the flash string methods.

p.s.  mark this thread as answered, if you can.

2 replies

Known Participant
November 24, 2009

Here's what I tried ... as you can see, I'm out of my depth here ...

var cnn:URLRequest = new URLRequest();

cnn.load(new URLRequest("http://rss.cnn.com/rss/edition.rss"));

liveFeed_txt.load.cnn;

Thanks again

Known Participant
November 24, 2009

Hi Kglad ... thanks for responding.

Would you be able to paste in some sample code that I could reconfigure?  I'm in over my head here ... especially with PHP.  I've only briefly used PHP to process server side form handling ... I don't really know PHP at all.  Any help would be greatly appreciated.

kglad
Community Expert
Community Expert
November 24, 2009

i use php to return the feed to flash because that avoids flash player security problems.  you would use the urlloader class to retrieve the feed from the php file.