Help Center Manage Your Account Banner, Richmedia, and Text Ads

Tutorial - Create a simple SWF with clickTAG tracking

Clicks on a Flash ad (SWF file) can't be tracked if the click button is assigned a static link. AdSpeed uses the industry-standard clickTAG parameter to eradicate this problem. After using clickTAG in the ActionScript, the SWF file will be expecting a dynamic URL to be provided from outside. This dynamic URL comes from the Destination URL field when you create an ad within AdSpeed. These are the basic steps to create a simple SWF file with click action and tracking enabled.

Video Tutorial - ActionScript 2

i
Video Tutorial

Video Tutorial - ActionScript 3

i
Video Tutorial

Create a new SWF file

  • Open Adobe Flash
  • In the General tab, choose either ActionScript 2.0 or ActionScript 3.0.
  • In the Property inspector, edit size values to set the desired dimension for the flash ad
  • Alternatively, you can choose a popular template to work with by following the menu File > New > Templates > Choose an ad dimension
  • Design your SWF file using texts, lines, shapes

Create a click button with ActionScript 2.0

If you choose ActionScript 2.0 at the beginning, you can create a button which links to your destination website upon clicking with these steps:
  • Draw the shape of the button and customize as needed.
  • Select the shape, then right click, and choose Convert to Symbol
  • Choose Button for the 'Type' box and enter the name of button
  • Follow File > Publish Settings > Choose ActionScript 2.0 for the 'Script' box
  • Right-click on the button and choose Action
Add the following ActionScript code snippet into the script box:
on (release) {
  if (_root.clickTAG.substr(0,4) == "http") {
    getURL(_root.clickTAG,_root.TargetAS);
  }
}

Create a click button with ActionScript 3.0

If you choose ActionScript 3.0 at the beginning, you can create a button which links to your destination website upon clicking with these steps:
  • Draw the shape of the button and customize as needed.
  • Select the shape, then right click, and choose Convert to Symbol
  • Choose Button for the 'Type' box and enter the name of button
  • Select the button, give it an instance name in the Property inspector.
  • Select a keyframe in line with the button
  • Click on the tab Action Frame to open the keyframe script box
Add the following ActionScript code snippet into the keyframe script box:
MyClickButton.addEventListener(
  MouseEvent.CLICK,
  function():void {
    if (root.loaderInfo.parameters.clickTAG.substr(0,4) == "http") {
      navigateToURL(
        new URLRequest(root.loaderInfo.parameters.clickTAG),
        root.loaderInfo.parameters.TargetAS
      );
    }
  }
);

In the above short sample code, MyClickButton represents whatever instance name you chose for your button symbol.

If you actually used MyClickButton, you are done; otherwise, change the above code to match the instance name.

Use this SWF file in AdSpeed

  • If you do not have Fast Delivery add-on, you would need to upload your SWF file to an online location and get its URL first. If you already subscribe to Fast Delivery add-on, you can simply upload the file directly to our servers from your local computer
  • Create a new ad
  • For the Image/Media URL box, enter your SWF file location URL
  • Enter the Destination URL, this is where the visitor should go when she/he clicks on the ad
Congratulations! Your SWF/Flash file now uses clickTAG as a dynamic link and is prepared for tracking across all industry-standard ad servers.

To convert an existing Flash ad for tracking with clickTAG, please refer to this page.

Other Articles in Banner, Richmedia, and Text Ads

Information about different ad formats, dimension, sizes, and specifications.

Cannot find an answer for your question? Ask our Customer Care team

Related