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...

Well, today We reached a thousand downloads of the pre-releases of the Flashfeed extension. I'm currently a bit busy freelancing but I hope to release a new version soon. I've found a little bug when feeding frontpage xml. Anyway, that's all

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.

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
How to use

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.

For the coming 0.04 release of the Flashfeed extension, I wanted to create a Joomla component that when installed, it also installed files into other folders than just its own com_flashfeed folder. In my project, I wanted to install extra views into the com_content folder. After desperatly searching for solutions, I ended up banging my head against the wall several times. It was not until I read a post at the Joomfish homepage that I got on track.

I finally found the solution yesterday. The way to do it is to use a custom install file in the XML manifest, and then initially install the files in the component folder, but afterward move it with the JFile class:

Creating the XML File

First of all we want to create our component XML manifest file. To test it, I create a simple XML file with just one file in it:

<?xml version="1.0" encoding="utf-8"?>

<install type="component" version="1.5.0">
       
        <name>Flashfeed</name>
        <creationDate>2009 04 01</creationDate>
        <author>Rune Skjoldborg Madsen</author>
        <authorEmail> This e-mail address is being protected from spambots. You need JavaScript enabled to view it </authorEmail>
        <authorUrl>http://www.youcanjoomla.com</authorUrl>
        <copyright>Rune Skjoldborg Madsen</copyright>
        <license>GNU/GPL</license>
        <version>0.02</version>
        <description>Feed XML from Joomla into Flash</description>
 
        <installfile>install.flashfeed.php</installfile>
        <uninstallfile>uninstall.flashfeed.php</uninstallfile>
 
        <!-- Site Main File Copy Section -->
        <files folder="movefiles">
                <filename>com_content/views/article/view.xml.php</filename>
        </files>
 
        <administration>
 
                <!-- Administration Menu Section -->
                <menu link="option=com_flashfeed">Flashfeed</menu>
 
        </administration>
   
</install>

If you're not familiar with the xml manifest, then please refer to the Joomla Docs. What's important is, that in my zip install file, I've added a folder called "movefiles" where all the files I want to install into other folders than my document root are located. For the moment, I have only one file:

<files folder="movefiles">
    <filename>com_content/views/article/view.xml.php</filename>
</files>

Notice the "folder" attribute. This will tell Joomla to copy from "movefiles/com_content/views/article/view.xml.php" in my zip package to "com_flashfeed/com_content/views/article/view.xml.php". This is the place where we want to move the file from in our custom install script (called install.flashfeed.php in the xml.

Moving the file from standard component location

When our custom install script is called, out files are already uploaded. Therefore all we need to do is to move the file to the location we want to. This is the entire install.flashfeed.php file:

<?php
defined( '_JEXEC' ) or die( 'Restricted access' );

jimport( 'joomla.filesystem.file' );

function com_install()
{
    $fileloc = 'com_content/views/article/view.xml.php';

$from = JPATH_ROOT.DS.'components/com_flashfeed/'.$fileloc;
$to = JPATH_ROOT.DS.'components/'.$fileloc;

if(!JFile::move($from, $to))
    {
        echo 'something went wrong';
    }
}

?>

All we're basically telling it is to move the file from the "com_flashfeed" folder to the "com_content" folder.

Tadaaaa!

And there we are. This caused me serious headaches and some desperat posts in the forums, so I hope it will be of some assistance to you.

Page 1 of 4

RSS Feed

feed-image Subscribe

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.