Featured FLA
» Author: Bugra Ozden
» Title: Skatalog v9 - product catalog
» Description: Create your product catalog easly and publish on your website or Create your image gallery, documents list, portfolio. Fully XML Driven
» More by Bugra Ozden
Featured Site
» Posted in the Flash Kit Links section
» Title: Creative DW Image Show PRO
» Description: Creative DW Image Show PRO is a Dreamweaver extension which enables the user to create multimedia presentations. It combines the features of the popular Creative DW Image Show with the ability to add professional text effects to slides (similar to After Effects). The product is very customizable: the user can choose the duration of the transition effects, the slide motion start and end position, zoom and panning type for both images and texts.
RSS keeps growing in popularity, and so we find ourselves playing with RSS feeds in new and interesting ways... or perhaps it's the other way around?!?!
Adobe (Formerly Macromedia) Flash is moving more and more towards XML and OOP paradigms. So I've taken it upon myself to write some classes for parsing through Flash's XML to get RSS feeds.
Q: What's this mean to me? A: You can use my pre-written classes, to utilize RSS feeds inside of Flash.
Q: What can I do with this?
A1: You can now make fun interfaces to interact with your favorite RSS Feeds. A2: You can instantly update promotional information for your site, in all of your flash creations simultaneously.
LET'S GET STARTED!
EASY: Since most of the code is written already, you can get using it in just a few steps. 25 lines of code INCLUDING COMMENTS AND SPACES!
COMPLEX: For those of you who are interested in the insides of the objects, they are well documented, so have at them. If you augment them in any way, please let me know! Also give me credit plzthnx.
STEP 1: Initialization
On line 2 we set the path for the RSS URL. On line 3 we have another tested and true RSS feed for your testing purposes.
Starting at line 6 we instantiate 3 objects.
1) LINE 6: My parser class, which will parse the XML tree for us.
2) LINE 7: My RSS class, which will serve as the object that holds our info.
3) LINE 8: The inate Flash XML class, which will hold and load our RSS for parsing.
/* Programmed by Gant Laborde */
var URLofRSS = "http://www.BleachEatingFreaks.com/rss.php"
The Flash XML object has a property that will allow you ignore whitespace, and simplify processing. I set ignoreWhite to true.
// set the ignoreWhite property to true (default value is false)
xmlFeed.ignoreWhite = true;
We're going to set the XML to parse once it's done loading the page. So we override it's onload function on line 14.
On line 17, we use the parser to read the XML object that has finished loading. This gets read into the RSS object for our use!
On line 19 I then assign a textbox in the main stage to all the RSS file's contents. If you want to grab specific aspects the RSS object has the properties:
myTitle = The title of the RSS channel
myLink = The link to the site from the RSS feed
myDescription = RSS description
myLanguage = RSS language setting
myCopyright = RSS copyright
myItems = Array of Items in that channel. Where you are going to be most interested :D
Each item has it's own Title, Description and Link property.
To see in use, feel free to delve into the RSS object's printProperties() function.
// Load and parse
xmlFeed.onLoad = function(success) {
// take XML and make it an RSS object
objRSS = objRSSparse.createRSS(xmlFeed);
_root.rssReceived = objRSS.printProperties();
}; // end onLoad function
LASTLY!
Line 25 uses the Flash XML object to load the given URL and you're done!
// load the XML into the xmlFeed object
xmlFeed.load(URLofRSS);
CAVEATS: * This supports single part RSS like
* benxxx
*
* I did not write this to work for composite RSS like
*
In a cold calculus classroom awaiting a belligerent instructor, the outlandish conversations of life spawn. This is where Bleach Eating Freaks began. As students grouped together, common interests and quirks forged in scholastic stress invited the strange, and allowed for BEF to become a part of our lives.
I am a Bleach Eating Freak.