Accessibility
 
Home / Developer Center / Macromedia Flash Developer Center /

Macromedia Flash Article

Resource Menu Component

The new Resource Menu Component allows users to peruse content on a site in an engaging manner—while taking up very little screen real estate. This component, created by Allen Ellison, is based on the Macromedia Flash movie that debuted on the Macromedia Developer Center. We received so many requests for the FLA that we decided to release it as a component.

 

Macromedia Designer & Developer Center XML resource feed

 

In addition to releasing the Resource Menu Component, we've also created an ActionScript object which loads the Macromedia XML Resource feed, making it available as a XML object and a DataProviderClass. Since the Resource Menu Component can use a Data Provider Class to get data, this object can be used in conjunction with the Resource Menu Component to easily add the Macromedia XML Resource feed to your own site.

Download the componentsDownload the Resource Menu Component from the Macromedia Exchange
Download the componentsDownload the ActionScript object for Macintosh (SIT 56K)
Download the componentsDownload the ActionScript object for Windows (ZIP 56K)

Note: Once the Resource Menu Component is installed, a help file for the component is available in Macromedia Flash MX (Window > Resource Menu Help). To use the ActionScript object, place a copy of the FResourceFeed.as file in the same directory as the FLA file that the object will be used in. Then include the AS file in the code for the FLA as shown below.

Here is an example of the ActionScript code necessary to load the Macromedia XML Resource feed and then display it in the Resource Menu Component:

#include "FResourceFeed.as"

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

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

rMenu is an instance of the component in the movie, and FResourceFeed is the ActionScript object (which you can download above) to load the XML Feed.

Since a Macromedia Flash movie running in a web browser cannot load data from a domain outside its own, some middleware is required to pass the XML to the SWF. The SWF file could then load the XML from the middleware and not from the Macromedia domain. The middleware retrieves the XML from Macromedia website and returns it to the SWF.

Here is an example of the code:

#include "FResourceFeed.as"

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

xml_feed_proxy.cfm is a very simple ColdFusion page which is included in the download and has the following code:

<cflocation url=" http://www.macromedia.com/devnet/resources/macromedia_resources.xml"/>

Pretty simple. Of course, the same technique could be used with Java, JSP, ASP, PHP, or just about any other middleware language.

To see live examples of the Macromedia XML Resource feed in action, check out this week's Logged In article. For more information about the XML feed itself, see Macromedia Developer Center XML Resource feed.