PDA

Click to See Complete Forum and Search --> : Headlines and news from XML



mikebrittain
05-05-2001, 10:16 PM
I just finished up a project using XML for two parts. It was created for a class that I'm taking.

I'm interested in getting some feedback on the approach that I took and the content. Any ideas for extending this?

http://www.embimedia.com/mike/school/3502/moreover_xml/

The movie that I made is banner-ad style, but is a news ticker. The headlines are taken from news feeds provided by moreover.com.

The buttons at the bottom are all generated by an XML file defined in the query string of the URL calling the Flash movie .... ex.


<PARAM NAME=movie VALUE="moreover_xml.swf?categories_news.xml">

The XML file that defines the buttons looks like this:


<?xml version="1.0" encoding="iso-8859-1" ?>
<newsfeeds>
<category>
<name>Denver and Boulder</name>
<shortname>denver / boulder</shortname>
<url>moreover_fetch.php?o=xml&c=Denver%2DBoulder%20news</url>
</category>
<category>
<name>Top Sports Stories</name>
<shortname>top sports</shortname>
<url>moreover_fetch.php?o=xml&c=Sports%3A%20top%20stories</url>
</category>
<category>
<name>Financial Times</name>
<shortname>financial times</shortname>
<url>moreover_fetch.php?o=xml&feed=145</url>
</category>
<category>
<name>Travel</name>
<shortname>travel</shortname>
<url>moreover_fetch.php?o=xml&c=Consumer%3A%20travel%20news</url>
</category>
</newsfeeds>

... and finally, the XML stream is captured by a request that is delivered through a PHP file. The PHP file simply takes the query from its own query string (see the <url> tag in the XML file above) and redirects the request to moreover.com -- returning the results to the Flash file when they are received. This was a workaround since the Flash XML object does not allow for requests to XML files outside of the originating movie's subdomain.

The same movie is used on three separate pages that use different query strings to initialize the buttons within the movie for different categories of news content.

The .fla is available on my site. Please let me know if you find some of the code useful. I plan to make it available outside of the .fla soon.