Actionscript 3 - Written by Artluvr on Sunday, November 30, 2008 22:25 - 0 Comments

XML based banner rotator - Actionscript 3, Flash CS3


DEMO HERE

This is a simple xml based, banner rotator. It is made with Flash CS3 and AS3. Fully customizable and this means that you can change the following:

Fron inside BannerRotator.as file

const BANNER_NUMBER_SPACING:Number = 30; //the spacing between the number boxes
const BANNER_NUMBER_ALPHA:Number = 0.5; //the initial alpha of the number boxes
const BANNER_SHOW_TRANSITION:Number = 0.5; //the duration of the transition when the banner will be shown
const DELAY:Number = 6000; //after how many miliseconds the next banner will be shown
const LOADING_COLOR:uint=0×000000; //the color of the loading bar
const LOADING_ALPHA:Number=0.5; //the alpha of the loading bar

From inside BannerNumber.as

const NUMBER_FONT:String = “Arial”; //the font of the banner’s number
const NUMBER_FONT_SIZE:Number = 12; //the font size of the banner’s number
const NUMBER_FONT_COLOR:uint = 0xffffff; //the font color of the banner’s number
const NUMBER_BG_COLOR:uint = 0×000000; //the color of the number background
const NUMBER_BLUR_ALPHA:Number = 0.5; //the initial alpha of banner’s number
const NUMBER_TRANSITION_TIME:Number = 0.3; //the duration of the transition when you put your mouse over a banner’s number

From inside the BannerImage.as

const IMAGE_TITLE_FONT:String = “Arial”; //the title font
const IMAGE_TITLE_FONT_SIZE:Number = 16; //the title font size
const IMAGE_TITLE_BOLD:Boolean = false; //is the title bold?
const IMAGE_TITLE_COLOR:uint = 0xffffff; //the color of the title
const TITLE_X:Number = 10; //the X offset of the title
const TITLE_Y:Number = 10; //the Y offset of the title
const TITLE_MAXIMUM_WIDTH:Number = 480; //the titles maximum width

Fron inside the XML file

URL redirection by clicking on each banner
Descriptions

The xml structure looks like this:

<banner title=”Welcome to Artluvr.com” file=”banners/1.jpg” url=”http://www.amazon.com”></banner>

Finally, you display it by simply writing the following code:

import br.BannerRotator;

var brot:MovieClip = new BannerRotator(500,247, “”banners.xml”);
addChild(brot);

The above code will create a banner with width 500px, height 247px and will read the file “banners.xml”.

Price: € 6



Share and Enjoy:

Leave a Reply

Comment

Most Popular Content




Image Galleries


Menus & Buttons


Utilities


Freebies