In this article you will create a tabbed ad that contains an introductory graphic, a viewer-selected video in an external movie, and a fill-in form. You can review the finished ad in the goAwayAd.fla movie. The first step in creating a rich media ad using the Flash Ad Kit is to select a Flash Ad Kit template and design your ad.
Deciding on a template is relatively straightforward:
The Flash Ad Kit provides several different types of ad templates for expandable ads and a general template for all other kinds of Flash ads (see Figure 2). Select the general template and click OK.
Figure 2. Selecting from the ready-to-use Flash Ad Kit templates
Publisher site requirements generally do not allow a Medium Rectangle to be more than 30K; on some sites the maximum is 20K. Usually time constraints force you to create ads for the lowest common denominator publisher, so make goAwayAd.swf a 20K ad.
In order to minimize the file size of the base Flash ad to meet the publisher's site requirements, an external SWF file containing the video elements is loaded when the viewer clicks a button to view the video. If the video were contained in the main ad, there would be no way to fit it into the 20–30K maximum size that most publishers require for Medium Rectangle rich media ads.
Before continuing with the rest of the tutorial, load goAwayAd.fla and open the Library panel. Now you can use the assets in its library to recreate this ad. Be sure to click on the goAwayAdLearn.fla tab before continuing.
Select the Content layer and insert 10 new layers. From top to bottom, name the layers beneath the Script layer as follows:
A useful beginning of the design phase is to think about the kinds of interactions you want to track within the ad. In this ad, useful events to track could be the selection of each tab, the time spent in each tab, user selection of the video, length of time the user watches the video, and user drop-off from the fill-in form.
Each ad made with the Flash Ad Kit requires a clickthrough URL. In this ad, it goes to the home page of the Flash Ad Kit:
On Frame 10 of the Script layer, add the following code to automate and track the clickthroughs:
clickThrough.onPress = function(){
_root.conduit.exit(1);
}
You can either enter the above exit code by hand or enter it automatically from the Flash Ad Kit functions folder on the left side of the Actions panel. In the set of Event Functions under the Flash Ad Kit folder, double-click the "exit" function to add it to your code (see Figure 3). Add 1 between the parentheses to complete the code. (You have to add the clickThrough.onPress = function() part by hand, however.)
Figure 3. Adding code to automate and track clickthroughs
Switch to the first frame of the Links and Descriptions layer. Go to the set of variables beginning with exit1 and add the following code:
exit1 = "http://www.macromedia.com/software/flash/flash_ad_kit/"; exit1window = "_blank"; exit1windowFeatures = ""; exit1name = "ClickThrough1"; exit1desc = "exit click from the background button";
Adding unique events to track what happens in the ad is easy. One example is to add an event to the tab buttons to find out if viewers click to see the video or sign up for a free sample of the product:
Place the following code on the Script layer in Frame 11:
tab2.onRelease = function() {
_root.conduit.event(1);
gotoAndPlay("tab2");
};
Switch to the first frame of the Links and Descriptions layer. Go to the set of variables beginning with "event1" and add the following code:
event1name = "mainToVideo"; event1desc = "click from the main tab to the video screen";
In Line 10 of the Links and Descriptions layer, remove the forward slashes from the line of code so it looks like this:
conduit_debug = true;
This turns on a debugger so you can test that your events are working.
Adding timers to the tab buttons so you know how long a viewer watches each screen is also a straightforward procedure. This can provide useful information to determine how well an ad performs in the real world:
Place the following code in Frame 19 on the Script layer:
_root.conduit.startTimer(1);
In order to stop the timer and get a proper value for time spent on the video screen, add stopTimer functions to the tab buttons that switch to the other screens. In Frame 19 of the Script layer, add the following code:
tab1.onRelease = function() {
_root.conduit.stopTimer(1);
gotoAndPlay("tab1");
}
tab3.onRelease = function() {
_root.conduit.stopTimer(1);
gotoAndPlay("tab3");
}
Switch to the first frame of the Links and Descriptions layer. Go to the set of variables beginning with "timer1" and add the following code:
timer1name = "videoTime"; timer1desc = "time spent in the video screen";
The ad will now send tracking information to the ad server about the time spent on the video screen.
You can add further events and timers to each part of the ad. For example, each input text box could contain an event so that you could track where users stop filling out the form. This information could help you improve the ad's effectiveness.