How to insert a Click Tag (clickTag) into your Flash Banner for the DART Ad Network
First of all be conscious of what version of Flash you have. Many tutorials skip this step and because each version of Flash may have new Action Script commands, older commands may no longer be viable. For example some scripts that work in Action Script 2.0 will produce errors and not function in Action Script 3.0.
The following Tutorial is written for Action Script 2.0. You can set your Action Script in the Action Script Panel.
You can set your Action Script Publish Settings by going to File > Publish Settings or Ctrl + Shift + F12 & Then select your Action Script from the drop down list
You can also go to File > Publish Settings and under script select the appropriate script ActionScript 2.0
Creating the ClickTag
- Create a new layer (Insert > Timeline > Layer) above all other layers, name it "click" - and select the first keyframe in that layer.
- Using the Rectangle tool, draw a rectangle encompassing the entire area of the ad.
- Convert the rectangle to a button.
[using the Selection tool, right-click and select Convert to Symbol. Type a name ["clicktag"] for the symbol and select the Button behavior. Click "ok".] - Double-click the rectangle [go into symbol editing mode] to edit it, and drag the Up keyframe to the Hit keyframe.
- Go back to the main timeline and select the button on frame one of the "click" layer. Open the Actions panel [If the Actions panel is not open, choose Windows > Actions (F9)].
- Go back to the main timeline and select the button on frame one of the "click" layer. Open the Actions panel [If the Actions panel is not open, choose Windows > Actions (F9)].
Note: Make sure "Actions - Button" displays at the top of the panel. - The code below will allow ad serving networks to dynamically assign a clickTAG to their ad. Copy and paste the following code verbatim into the ActionScript field:
Flash MX/Flash 6:
getURL(clickTAG) & choose "_blank" by the window option in the action window
Flash MX 2004/Flash 7:
getURL(clickTAG,"_blank")
Flash < 8 ActionScript 2.0:
on (release) {
getURL (clickTag, "_blank");
}
Flash 9 ActionScript 3.0:
on (release) {
getURL (_level0.clickTag, "_blank");
}
Publishing the Banner
- Click on the File menu and select Export > Export Movie... as shown in the screenshot below.
- Make sure your publishing settings appear as shown in the screenshot below. In particular the minimum Version of the Flash player to require should match the one of the ActionScript code you chose to assign to the button. Most of the other settings can be changed at your discretion, but enabling compression is generally recommended.
- At this point, you are ready to set up your published SWF file as a Flash banner in your ad server. Congratulations!
Troubleshooting
Case Sensitivity
Did you export the SWF file for your banner for Flash version 8 or 9? These versions of Flash treat the clickTAG parameter name case sensitively. If you did not copy and paste the ActionScript code, verify that all occurrences of the parameter name are spelled exactly as clickTAG and if that does not work try a different capitalization. The standard is to use clickTAG, but your ad server might use clickTag, ClickTAG, ClickTag or some other variation. Make sure to change every occurrence of the parameter name in the ActionScript code though as they must all match exactly to work properly!
Embedded URLs
Another common mistake is to replace "http:" in the ActionScript code with a link. The purpose of that code is to verify the protocol of your link is HTTP. That is necessary to prevent your banner from being utilized in cross-site scripting attacks, so you definitely don't want to alter or remove that! Where your link actually goes is in your ad server, which will dynamically inject the link into the banner at the time of serving. No link(s) should ever be embedded in the Flash banner directly.
Pop-up Blocking
Did you export the SWF file for your banner for Flash version 4, 5, 6, or 7? Internet Explorer versions 7 and 8 when used with Flash plugin version 10 do not permit SWF files exported for those older versions to use _blank for the target frame. They are considered to be pop-up windows and blocked. The only workarounds are to use _top for the target frame or to export the SWF file for FLash 8 or 9.