Update! I updated the examples with the import statement, as I got a lot of questions about the "FlashFeed not found" error. Offcourse, as in all of AS3, you have to import the classes before you can use them. Also remember to add the classes to your classpath or copy the com folder into the same folder as your .fla file.

Even though the FlashFeed component is still in a very early stage (I have no time to develop it further right now), I get a lot of questions from people asking how to use the FlashFeed Actionscript 3 class.

Most of them go wrong when trying to type the whole URL to their article, like www.mysite.com/index.php?option=com_content&view=article&id=1&format=xml. But the FlashFeed does all this automatically for you, so you only have to write the URL to your site and use the FlashFeed methods.

Here is a number of samples that show exactly how to write the Actionscript...

This loads an XML file with the data from the article with an id of 5

import com.runemadsen.joomla.*;

var joomlaData:FlashFeed = new FlashFeed("http://www.myjoomlasite.com");
joomlaData.addEventListener(Event.COMPLETE, handleData);
joomlaData.loadArticleByID(5);

function handleData(e:Event):void
{
trace(joomlaData.data); // outputs the XML file
}

This load an XML file with data from all the articles in the category with an id of 1

import com.runemadsen.joomla.*;

var joomlaData:FlashFeed = new FlashFeed("http://www.myjoomlasite.com");
joomlaData.addEventListener(Event.COMPLETE, handleData);
joomlaData.loadCategoryByID(1);

function handleData(e:Event):void
{
trace(joomlaData.data); // outputs the XML file
}

This load an XML file with data from all the articles in the section with an id of 1

import com.runemadsen.joomla.*;

var joomlaData:FlashFeed = new FlashFeed("http://www.myjoomlasite.com");
joomlaData.addEventListener(Event.COMPLETE, handleData);
joomlaData.loadSectionByID(5);

function handleData(e:Event):void
{
trace(joomlaData.data); // outputs the XML file
}

This load an XML file with data from all the articles on the frontpage

import com.runemadsen.joomla.*;

var joomlaData:FlashFeed = new FlashFeed("http://www.myjoomlasite.com");
joomlaData.addEventListener(Event.COMPLETE, handleData);
joomlaData.loadFrontpage();

function handleData(e:Event):void
{
trace(joomlaData.data); // outputs the XML file
}

Please remember to change the http://www.myjoomlasite.com with you sites URL - without the index.php part...

Comments (4)
AS2
1 Thursday, 01 October 2009 13:30
Jonas
Hello,
your tool is exactly what I need for the development of a Flash-page.
Unfortunately I have no idea about Actionscript 3 - so my entire Page is in AS2. I'm looking for a way to integrate your code in AS2 - any advices ?
Thanks a lot, Js
displaying xml in my file
2 Tuesday, 26 January 2010 11:50
John Lewis
Hi

I have now got this working correctly with no compiler errors but could use a little info as I'nm learning as I go! How do I now print the contents of the xml in my flash file? I can see the file is reading as it should as the output displays my joomla site, but no text shows in doc. Do I make a dynamic text box then give it a certain instance name?
Hello?
3 Sunday, 07 February 2010 19:40
John Lewis
Hi Rune

I would be happy to buy you pasta and ketchup if you would just help me implement this. I'm currently at a standstill. Are you still alive?
Connecting flash map with AS3+XML to joomla articles
4 Thursday, 18 February 2010 16:03
Pablo Calderon
Hi I'd like to know if this module would help me to show images of the article that are in specific folders when i mouse over any country and then when i press the country go to that particular article link... any help in this matter would be pasta and ketchup appreciated :D thanks

Add a comment

Your name:
Your email:
Your website:
Subject:
Comment:

Search

Donate

Please consider making a small donation to the development of the Flashfeed extension, this blog and my other Open Source projects. The products are all free and developed in my spare time when I'm not studying. In other words, help me buy pasta and ketchup.