Actionscript 3 - Written by Artluvr on Sunday, November 30, 2008 22:25 - 4 Comments
XML based banner rotator – Actionscript 3, Flash CS3
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:
4 Comments
German Moran
Mr. Moran you did it correctly, and it worked fine for me. And it opened the assigned, from the XML, URL
RuiS
Can i change width 500px, height 247px for anothers dimensions?
@RuiS, ofcourse you can.
Leave a Reply
Most Popular Content
- thecodemonster.net has a new logo
- XML Based Fullscreen Image Rotator With Proportional Resize – Flash CS3 – Actionscript 3
- MP3 Player – XML based – Flash CS3, Actionscript 3, Tweener
- XML based banner rotator – Actionscript 3, Flash CS3
- Image Panning on Mouse Move – Actionscript 3 – Flash CS3
- XML Image Gallery – Actionscript 3, Flash CS3, Tweener
- XML based image gallery – Actionscript 3, Flash CS3, Tweener
- Scrollbar with easing – Actionscript 3 – Tweener – Flash CS3
- 3D Carousel XML based – Actionscript 3, Flash CS3
- Papervision3D Spiral Carousel
- Depth of Field with Papervision3D & Tweener
- @Sulaiman, you can do it by removing every child inside the movieclip, and then ...
- @william, The calendar is a movieclip. You can just move it by changing the x an...
- @fuya, unfortunately you cannot add thumbnails, neither the gallery can autoplay...
- @jck, It's not the scroller's fault. Flash has a limit on the height of textfiel...
- Hi, I just started using the scroller, but I'm having trouble with a long text, ...
- The gallery is great.
To customize, I would like to know how can I make the g...
- how do i actually move the calendar along the x and y axis. i can move the backg...
- hi Artluvr,
thanks for this. one quick question:
any idea how i could swit...
Image Galleries
- XML Based Fullscreen Image Rotator With Proportional Resize – Flash CS3 – Actionscript 3
- XML based banner rotator – Actionscript 3, Flash CS3
- XML Image Gallery – Actionscript 3, Flash CS3, Tweener
- XML based image gallery – Actionscript 3, Flash CS3, Tweener
- Auto Resize XML Image Gallery – Actionscript 3, Flash CS3, Tweener
- XML Based Zoom Gallery – Flash, Actionscript 2, FuseKit
Menus & Buttons
Utilities
- MP3 Player – XML based – Flash CS3, Actionscript 3, Tweener
- Image Panning on Mouse Move – Actionscript 3 – Flash CS3
- Scrollbar with easing – Actionscript 3 – Tweener – Flash CS3
- XML graph like Google Analytics – Actionscript 3, Flash CS3
- XML based MP3 Player Streaming Compact – Actionscript 3 – Flash CS3
- Events Calendar – XML based – Actionscript 3, Flash CS3, Tweener
- 3D Windows that rotate when you drag them – Papervision 3D 2, Actionscript 3, Flash
- XML based news bubble – Actionscript 3 – Flash – Tweener
- Magnifying glass zoom – Flash, Actionscript 2
- Interactive Snow with OOP Actionscript 2

I want the URL to load in the same window as the Flash Animation. Below is the code I changed in BannerImage.as
private function banner_CLICK(e:MouseEvent):void{
navigateToURL(new URLRequest(this._url), “_self”);
}
However, the code is not reaching that area because when I change this._url, it still goes to the URL assigned in the XML Document.
Let me know if loading the URL in the same window is possible…
Thank you in advance.