Freelance programming services.

Brighton, London & the South East.

PHP, MySQL, JavaScript, WebGL, JQuery, Processing.js, Three.js,
ActionScript, Flash, Flex, AIR, Away3d,
Processing, OpenFrameworks, C++, OpenCV, OpenNI, OpenKinect, Android, iOS, PhoneGap, HTML5, Unity.

Technical project management.
Consultancy.
Cross platform device strategies.
Creative coding.

Please for current availability.

Covering Brighton, London & the South East

Please for current availability

Make Your Own Flash Carousel

The simplest ideas are always the best. I did a project a few months back with the very talented Paul Lloyd of FourTwo.net. We built a little Flash carousel component in AS3 for a corporate client. And it came out pretty well.

The data that runs it all came from a remotely hosted XML, so rather than use a fixed set of cards, a whole new application could be created just by pointing it at another XML. Which is what I have done here – making some of my blog posts look pretty.

Now here’s the cool bit – if instead of using a fixed URL I tell the swf file to read the path to the XML from the QueryString, it becomes reusable by anyone. Even you. Here’s an example:

This is the url of the carousel: http://actionscripter.co.uk/projects/carousel/

Create a new XML, and upload it somewhere, eg.
http://www.zenbullets.com/portfolio.xml

… then give the URL of the new XML to the carousel …
http://…/carousel/?http://www.zenbullets.com/portfolio.xml

… and, wahay, we have a slick looking carousel showcasing a selection from my portfolio.

The structure of the XML should be self explanatory, so feel free to try it. Except when you try it with your own URL it doesn’t work. Why is that?

There’s one more thing you need: you have to give permission for the Flash file to use data from your domain. Flash Player has very tight security features, and won’t let swfs grab data from other domains, unless that domain has said it’s okay by putting a crossdomain.xml file on the top level. This applies both to the URL of the XML and the URLs of any images specified inside that XML. For more info, see here. The crossdomain.xml I used for the example above is here, if you copy this and put it at the top level of the domain where you placed your XML/images it should do the trick.



posted August 22nd, 2008



« »


Mauricio R Valarini said...

Hi seached your name in the site… but didn’t found it… anyway, I would like to say that this application its a amzing… just becouse its like you said… simple and efficient…

anyway.. I am new in flash… and I am creating all my portfolio from now… this site that I inserted in the form it is my very very first website in flash…
actually not very well… like your applications… as far as i can se…

So… I would like to ask if you could give some highlights to me…. I would like to create an aplications just like that… not just use it… but create, understand the concept… you know?

If you could help me, I just be so glad for this….

Thanks in advance,

Bye…

Mauricio R Valarini




Add your comment



pingback: flash carousel

pingback: Make Your Own Flash Carousel | ActionScripter.co.uk: Freelance Flash, Flex, Processing & OpenFrameworks