FResourceFeed.as

Class FResourceFeed extends XML
Object
   |---XML
        |---FResourceFeed
Scope : _global
Type : class
Include Path : FResourceFeed.as
See Also : DataProviderClass (included with a number of components).

Version 1.0
Mike Chambers
mesh@macromedia.com

The FResourceDataFeed is a class that loads and parses the Macromedia XML Resource feed described at:
http://www.macromedia.com/desdev/articles/xml_resource_feed.html

It extends the XML object and thus can be parsed just like an XML object.

In addition, it provides a method that returns the data feed as a DataProviderClass which allows you to use the data with DataProviderClass aware components..

The code below loads the XML feed from Macromedia.com and then passes it to an instance of the Resource Menu Component.

#include "FResourceFeed.as"

var rf = new FResourceFeed();
rf.onXML = function()
{
	rMenu.setDataProvider(this.getDataProvider());
}

rf.load("http://www.macromedia.com/desdev/resources/macromedia_resources.xml");

The FResourceFeed contains one call back method, onError, that you can override in order to be notified if any errors occur. The onError method is passed an object. You can access a description of the error through the description property of the object.

#include "FResourceFeed.as"

var rf = new FResourceFeed();

rf.onError = function(error)
{
	trace("Error : " + error.description);
}

rf.onXML = function()
{
	rMenu.setDataProvider(this.getDataProvider());
}

rf.load("http://www.macromedia.com/desdev/resources/macromedia_resources.xml");

Inherited methods / properties

See documentation for the built in ActionScript XML object.

 

 

Methods / Properties

FResourceFeed(xmlFeed_xml)
returns : reference to instance of object created.

Constructor for FResourceFeed feed class. Optionally accepts a string of XML that represents the Macromedia XML resource feed.

var rf = new FResourceFeed();

 

setLink2Text(link_str)
returns : void

This methods sets the text that can be used as a secondary link. If it is not set, then the field will be blank

var rf = new FResourceFeed();
rf.setLink2Text("Visit the Designer / Developer center");

 

setLink2URL(link_str)
returns : void

This methods sets the URL that is associate with the secondary text. If it is not set, then the field will be empty.

var rf = new FResourceFeed();
rf.setLink2URL("http://www.macromedia.com/desdev/");

 

getDataProvider()
returns : DataProviderClass

This method returns a DataProviderClass which represents the information contained within the XML Resource Feed. This can be used in conjunction with components that accept a DataProviderClass.

The DataProviderClass returned contains the following fields:

  • logo
  • context
  • product
  • title
  • subtitle
  • linkURL1
  • link1
  • linkURL2
  • link2

Note that the DataProviderClass is included with a number of Macromedia Flash MX components, including the Resource Menu Component, List Box Component, and all of the Charting Components.