Be the first to write a review
Creating a banner ad manager
Creating a banner ad manager
Many web sites include banners that display advertisements. Often these are static JPEG or GIF images but sometimes, the banner rotates through a series of images, with a transition between each. In this tutorial, I’m going to show you how to use Flash to create a dynamic banner ad manager. You’ll be able to load external images and display them one at a time, with a fade in transition effect.
The Flash movie that we build will load external JPEG, GIF, PNG or even SWF files into the banner. You’ll be able to manage the settings from an XML file that contains the list of images as well as the timings for the fade effect. You can determine the length of the fade in or out as well as the length of time that each image displays.
I’ll cover the following areas in the tutorial:
- Loading an external XML document
- Creating a class file in AS2.0
- Working with the Transition Manager class
- Working with Set Interval
I’ve used ActionScript 2.0 with a single class file in this tutorial so you’ll need at least Flash MX 2004 to complete the example. I’ve assumed that you’re familiar with writing ActionScript and that you understand concepts like variables and loops. I’ve also assumed that you’ve got a basic understanding of the XML object. If not, you might want to refresh your knowledge with some of the earlier tutorials.
You can download the source files for the tutorial from the blue Properties box that contains the article PDF. There's a heading titled Code Download and you can click the Details link next to it to get the zip file. The download includes the starter files you'll need as well as the completed files.
Note: If you have difficulties downloading the source files or PDF, you might have a problem with your cookies. Delete the cookies from your machine and try again. In Internet Explorer, you can do this by choosing Tools > Internet Options… and clicking the Delete Cookies… button on the General tab.
Sas Jacobs
Hello. I'm the Principal of Anything Is Possible, an Australian web development business specialising in web applications development and training. I'm interested in using Flash with dynamic content and I've presented at a number of International conferences on topics relating to applications development, XML and scripting components. I have recently released my second print book Beginning XML with DOM and Ajax to match the first one - Foundation XML for Flash. I have a business web site
and a personal web site.