Basic AS3 XML Slideshow Class

I’m in the midst of creating a flash showcase site for work, and wanted to post some knowledge during my foray into the world of Actionscript 3. I’ve been working in AS1/AS2 since c.1999, so AS3 has been a bit of a learning curve. But I’m finally starting to get the hang of it.

Here’s a really basic XML Slideshow Class that fades images in and out. Once it gets to the end, it loops to show the first image. Pretty simple stuff.

You can use it however you like, but here’s how to instantiate in an .fla:

import com.marianomike.basicSlideshow;
//basicSlideshow(xml, time image shows in milliseconds, fade time, width, height, background color, text color, outline width, outline color, show drop shadow)
var slideshow:basicSlideshow = new basicSlideshow("slideshow.xml", 1000, 2, 500, 334, 0x000000, 0xFFFFFF, 2, 0x333333, false);
addChild(slideshow);

Image paths are pulled from slideshow.xml.

You’ll also need the Tweener classes which I’ve included in the zip. I have some other stuff, which I’ll post later too.

Download the Source

No Comments »