February
09
How to use FlashFeed
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...
February
09
A thousand downloads...
February
09
Flashfeed release 0.04
Info: FlashFeed is a project that enables the use of Joomla as backend to Adobe Flash sites. It is possible to edit and post your content in Joomla and feed it into a Flash movie, making Joomla an advanced CMS backend.
Today I've release the Flashfeed 0.04 release. The one major enhancement is that all parameters are now feeded in the xml. Try to click on the following links, and you will see the Flashfeed XML feed from this Joomla site:
View this article as XML:
http://www.youcanjoomla.com/index.php?option=com_content&view=article&id=52&format=xml
View this category as XML:
http://www.youcanjoomla.com/index.php?option=com_content&view=category&id=1&format=xml
View this section as XML
http://www.youcanjoomla.com/index.php?option=com_content&view=section&id=1&format=xml
View my frontpage as XML
http://www.youcanjoomla.com/index.php?option=com_content&view=frontpage&format=xml
The cool thing about this release is, that you're now able to add custom parameters to your articles, and these will show in the xml files too. Let's say you want a user attach images to the text they are writing in the articles. Flash can't handle <img> tags, so it won't work if the user inserts and image with the editor. But instead, just create an imagelist parameter in the administrator/components/com_content/models/article.xml file, and the user can now select an image to go with the text. And then you can load the image inside of Flash and do whatever you want. If you don't know how to add custom parameters to articles, take a look at my tutorial: image as article parameter.
Go to the downloads section to download the FlashFeed 0.04 release.
I'm planning on releasing the 1.0 version before summer, if I can get enough donations to be able to take some time off from my web freelancing duties. I'd also be glad to hear from anyone who's using the FlashFeed project. Your knowledge is really useful to future features / bugsquashing.
February
09
Flashfeed release 0.03
Info: FlashFeed is a project that enables the use of Joomla as backend to Adobe Flash sites. It is possible to edit and post your content in Joomla and feed it into a Flash movie, making Joomla an advanced CMS backend.
Today I've released a 0.03 version of the Flashfeed release. This has been a big step towards making Flashfeed a "real" Joomla extension. This time I've created the extension as a Joomla installer so it's easy to install on your Joomla sites. Simply download the com_flashfeed_003.zip file in the "Downloads" area and install it.
If you want to use your Joomla site as a backend to Flash, I've also added some new Flash classes. These can also be downloaded in the "Downloads" area. If you can't figure out how to make it all work, open the Example.fla and you will see a working example.
New Features
The new features in this release are:
- All XML handling is now done by the JSimpleXML class, which makes it PHP4 friendly
- You can now load all frontpage articles
- Metadata is feeded in article views
- Included install package
If you're not using the Flash classes, simple call the following urls to feed xml. Off courseĀ you have to target the index.php of your domain (e.g. www.yourjoomlasite.com/index.php......)
Article: (shows article with id = 1)
index.php?option=com_content&view=article&format=xml&id=1
Category: (shows all articles in category with id = 1)
index.php?option=com_content&view=category&format=xml&id=1
Sections: (shows all articles in section with id = 1)
index.php?option=com_content&view=section&format=xml&id=1
Frontpage: (shows all articles on frontpage)
index.php?option=com_content&view=frontpage&format=xml
Please remember that this is a 0.0x beta release, and use on production sites is at own risk!
The Flashfeed release works with SEF urls enabled and can be used with Joomfish. Simple write www.yourjoomlasite.com/en/index.php instead, and replace en with whatever language you have translated.
Go to the "Downloads" area to download the new release.
February
09
Flashfeed release 0.02
Info: FlashFeed is a project that enables the use of Joomla as backend to Adobe Flash sites. It is possible to edit and post your content in Joomla and feed it into a Flash movie, making Joomla an advanced CMS backend.
I decided to work a little bit on with the FlashFeed project. I've now programmed a small Flash class that extends the AS3 Loader class, and makes it simple to use the Flashfeed files. Download the files here. It works just like the last post explained, and in the .zip file you will find an example folder that shows a working FlashFeed project. All you have to do is this:
- Download the .zip file and unzip it
- Upload the contents of the "Joomla Files" to your Joomla root folder
- Use the class in the "Flash Classes" folder to communicate with your Joomla site
- If you can't figure it out, look in the "Example" folder
February
09
Flashfeed release 0.01
Info: FlashFeed is a project that enables the use of Joomla as backend to Adobe Flash sites. It is possible to edit and post your content in Joomla and feed it into a Flash movie, making Joomla an advanced CMS backend.
Finally I had some time off from my freelancing, and I spent a couple of days during Christmas testing my Flashfeed project. I decided to make a small .ZIP file, to be able to get some response. Notice, that this is a minor minor release, and I just putted it online for you to test.
The FlashFeed project is an attempt to build a strong and effective link between Flash and Joomla - that is to be able to use Joomla as backend to Flash. The final project will consist of a Joomla Installer Package AND a set of Actionscript 3 classes, so the Flash programmer doesn't have to mess around in Joomla all the time - all he has to do is to use the Actionscript 3 classes:
var joomlaData:FlashFeed = new FlashFeed("http://www.myjoomlasite.com");
joomlaData.addEventListener(Event.COMPLETE, handleData);
joomlaData.loadArticleByID(3);
function handleData(e:Event):void
{
// use article XML in joomlaData object
}
The above zip file has only 1 funtionality: It's possible to load and display article, category and section data. To use the files with your Joomla site (please, only for test purposes), do the following:
- Unzip the file and upload all of the contents to your Joomla root (make sure your FTp client merges the folders with your online folders of the same name)
- Test by calling the following URLS in your browser:
// where id is the article id to display
index.php?option=com_content&view=article&format=xml&id=1
// where id is the category id to display
index.php?option=com_content&view=category&format=xml&id=1
// where id is the section to display
index.php?option=com_content&view=section&format=xml&id=1
By using these URL's, you can actually get XML data from Joomla inside of Flash. And actionscript 3 test would look like this:
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, handleXML);
var urlString:String = "http://www.myjoomlasite.com/index.php?option=com_content&view=article&format=xml&id=1";
var request:URLRequest = new URLRequest(urlString);
loader.load(request);
function handleXML(e:Event):void
{
trace(loader.data); // output article xml from Joomla
}
Simple as that. Offcourse the final project will use the FlashFeed Actionscript 3 classes to make it even more convenient, but this should give you an idea of how FlashFeed will work.
Feel free to write comments and suggestions to me :-)


