You are browsing posts made during February, 2009

AS3 XML Random Banner Rotator

( February 17th, 2009 )

Here is a useful banner ad rotator. It loads a random image or swf file via XML everytime the page loads or is refreshed.

I have included error handlers for the XML file and banners.

(This file will open in Flash CS3) (Preview File)
Get Source


AS3 XML Scrollbar Class with CSS

( February 4th, 2009 )

I was asked if it is possible to apply external CSS properties to the XML instead of applying the formatting within the XML document itself.

Flash offers limited support for CSS properties, but I have used as much as I can.

I have also embedded multiple styles of the font, so you are able to apply normal, bold and italic styles to the text field via the stylesheet.

If you want to add error handlers for the XML and CSS files, please have a look at my XML News Ticker code.

(This file will open in Flash CS3)
Get Source


AS3 Simple Picture Slideshow

( February 3rd, 2009 )

I was thinking about the simplicity of swapDepths() in ActionScript 2.0 and thought that you might be curious as to how one swaps the depths of objects on the stage in ActionScript 3.0.

I have created a practical example which swaps the depths of images on the stage at regular intervals to create a slideshow. I have used the Tween class for the transition effect. My example makes use of:

  1. setInterval() – Swap pictures at a specified time interval.
  2. swapChildrenAt() – Swaps the depths of two pictures at specified index positions.
  3. getChildAt() – Returns the picture at the specified index position.
  4. Tween() – Used to tween the position of the top picture.

(This file will open in Flash CS3) (Preview File)
Get Source