A Flash Developer Resource Site














Internet Commerce

Partners & Affiliates














Developer Channel

internet.com


Featured Flash FLA
Gallery Downloads 11249 Flash Movies | 9 New Flash Movies Added
What's New | Top 100

Featured FLA

» Author: Matthias Kannengiesser
» Title: FS 3D Rotation Menu
» Description: This nice 3D Menü could be easy setup and we are quite sure you will like it - a preloader is included.
» More by Matthias Kannengiesser


Random FLAs | Add Flash Movie
Featured Flash Site
Gallery Downloads 6393 Flash Sites | 0 New Flash Links
What's New | Top 100 Flash Site

Featured Site

» Posted in the Flash Kit Links section
» Title: The Chopping Block
» Comments: The Chopping Block, Inc. is a full-service graphic design studio founded on the principle that good design spans all mediums.


Random Links | Add your own Flash Related Links
Flash Tutorials 1200 Tutorials 7 New Tutorials Added!
What's New | Top100

» After Effects Quality Effect using AS3
» FLV to 3GP: Convert video files from FLV (Flash Video) to 3GP for Mac
» create Christmas business flash presentation with hyperlinks
» Let Photos Show Your Happy Family this Christmas and Upload YouTube
» PowerPoint show to DVD slide show--- PPS to DVD
» How to burn FLV to DVD for Mac
» How to Create Christmas Flash Greeting Ecard with photos and music
» Getting Started In Flash
» How to convert FLV video to MP3 audio for Mac OS
» Unknown Tag: Title10
Random Tutorial | Add Site

bbm.netBBM.net is designed to save you time and deliver the highest quality royalty-free music for your multimedia projects. Features include: over 450 Music Loop Packages from some of the best composers in the business, our music search engine to speed your selection process, alternate music versions & bonus sounds to use for rollovers or transitions, free technical support and free consulting.

Click here for details »

Product Designer
Aquent
US-WA-Redmond

Justtechjobs.com Post A Job | Post A Resume


Tutorials Home What's New Top Rated Submit myTutes Random!

Search Tutorials


Categories OOP RSS via ActionScript 2.0
Author: Gant Laborde | Website: http://www.BleachEatingFreaks.com |

 
Page 1
1

AS 2.0 RSS Objects

OOP RSS in Flash ActionScript 2.0

CLICK HERE FOR EXAMPLE

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.

  1. /* Programmed by Gant Laborde */
  2. var URLofRSS = "http://www.BleachEatingFreaks.com/rss.php"
  3. //var URLofRSS = "http://www.digg.com/rss/index.xml"
  4. // Instantiate Objects
  5. var objRSSparse = new RSSparse; // rss parser
  6. var objRSS = new RSS; // rss class
  7. var xmlFeed:XML = new XML(); // Flash XML object

The Flash XML object has a property that will allow you ignore whitespace, and simplify processing. I set ignoreWhite to true.

  1. // set the ignoreWhite property to true (default value is false)
  2. 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.

  1. // Load and parse
  2. xmlFeed.onLoad = function(success) {
  3. // take XML and make it an RSS object
  4. objRSS = objRSSparse.createRSS(xmlFeed);
  5. _root.rssReceived = objRSS.printProperties();
  6. }; // end onLoad function

LASTLY!

Line 25 uses the Flash XML object to load the given URL and you're done!

  1. // load the XML into the xmlFeed object
  2. xmlFeed.load(URLofRSS);

CAVEATS:
* This supports single part RSS like
* benxxx
*
* I did not write this to work for composite RSS like
*

DOWNLOAD SOURCE!

REQUIRES>= FLASH MX 2004
http://www.bleacheatingfreaks.com/eBleach.php?file=http://www.BleachEatingFreaks.com/flash/RSS.zip

1

» Level Advanced

Added: : 2006-03-30
Rating: 8.43 Votes: 7
Hits: 879
» Author
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.
» Download
Download the files used in this tutorial.
Download (0 kb)
Get conversion and unzipping tools for PC and Mac here!

» Forums
More help? Search our boards for quick answers!

Please rate this tutorial, 10 is the top rating, you can also click the comments link to read/write a review.
10 9 8 7 6 5 4 3 2 1
Read or Post Comments
 
   
 

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers