
Instructions for designers of Flash banners
We have created template files which allow you to design your Flash banner around clickthrough and looping code that's been tested to work with our site. We strongly recommend that you use these templates if you're designing your banner from scratch. The links are under the "Template" headings below: please choose the appropriate one for your version of Flash.
Please do not add the URL of your web site to the code: doing this will prevent us from gathering click-through statistics for your ad campaign. |
Flash banners for mandy.com need to follow these requirements:
- The banner responds to clicks by loading the URL specified by the clickTAG variable.
- Animation stops after 30 seconds.
- File size should be 40K or less.
The best way of doing this depends on which version of Flash you are using:
Adobe Flash CS3 or CS4 (ActionScript 3):
clickTAG
Create a transparent button in the top layer that covers the entire banner. Convert it to a symbol, and name the instance "clickme_inst".
Place the following code in frame 1 of the button's layer:
var request:URLRequest = new URLRequest(root.loaderInfo.parameters.clickTag);
clickme_inst.addEventListener(MouseEvent.MOUSE_UP,
function():void {
if(root.loaderInfo.parameters.clickTAG.substr(0,5)=="http:") {
navigateToURL(new URLRequest(root.loaderInfo.parameters.clickTAG),"_self");
}
}
);
Looping
Create a label called "loopBack" in frame 2 of a new layer. This will be the point the banner returns to when it reaches the end.
Put the following code in frame 1 of the same layer, so that it goes before the label:
var playCount = 0;
And put the following code at the end of the banner. This example is set to show the banner's animation twice. Please adjust the number of repeats depending on the banner's play time, so that animation ceases by 30 seconds.
if(++playCount < 2) {
gotoAndPlay("loopBack");
} else {
stop();
}
Template
We have prepared a template which has the correct clickTAG and looping layers already in place. Download it here (ActionScript 3).
Macromedia Flash 4, Flash 5, Flash MX, Flash MX 2004, Flash 8 (ActionScript 1 or 2):
clickTAG
Create a transparent button in the top layer that covers the entire banner. Convert it to a symbol, and assign the following ActionScript code directly to the button (as an Object Action):
on (release) {
if (clickTAG.substr(0,5) == "http:") {
getURL(clickTAG);
}
}
Looping
Create a label called "loopBack" in frame 1 of a new layer. This will be the point the banner returns to when it reaches the end.
Put the following code at the end of the banner. This example is set to show the banner's animation twice. Please adjust the number of repeats depending on the banner's play time, so that animation ceases by 30 seconds.
if(++playCount < 2) {
gotoAndPlay("loopBack");
} else {
stop();
}
Template
We have prepared a template which has the correct clickTAG and looping layers already in place. Download it here (ActionScript 2).
For ActionScript 2 only, the procedure for adding a ClickTag is documented by Adobe on their own site: http://www.adobe.com/resources/richmedia/tracking/designers_guide/
|