FlashCanon Flash Platform stuff from Jason Fincanon

ClickTagger

Flash Advertising: Flash Platform Development of Microsites, Advergames and Branded Applications

Pre-order Flash Advertising on Amazon!

*Changelog and download link are at the bottom of this page*

ClickTagger is an ActionScript 3 class that I've written for my upcoming book and it was primarily built to solve for the case sensitivity issue that Flash developers may run into when using the clickTag variable in their banners. Without a current standard in place for ad serving companies, some use clickTag while others use clickTAG and still others use ClickTag or even clicktag. In ActionScript 2 this wasn't/isn't an issue, but as soon as a Flash developer or agency starts creating banners with AS3 they may very quickly encounter the problem by having their ads kicked back for not working correctly.

While writing ClickTagger, I decided to add a bit of functionality to it to allow the developer to not only assign the clickTags to the proper interactive elements, but to assign a fallback url as well. The fallback url works for local testing from the Flash IDE (where clickTags aren't passed in) and is also used in the unfortunate event that there's a problem loading the clickTags at run time. If the clickTags fail to load, at least the user will still be taken to the url you provide.

One more small piece to ClickTagger is the targetWindow property which can be used to set the window in which the destination url will launch. The targetWindow property is defaulted to "_blank".

To instantiate ClickTagger, there is a single required parameter of type LoaderInfo.

Actionscript:
  1. var clickTagger:ClickTagger = new ClickTagger(stage.loaderInfo);

To assign a clickTag to an interactive element, call the assignClickTag method and pass it three parameters: The clickable element (required), the fallback url (required) and the clickTag number (optional).

Actionscript:
  1. clickTagger.assignClickTag(button1,fallback1,1);

Here's an example that assumes you have three buttons named button1, button2, and button3.

Actionscript:
  1. import com.jasonfincanon.utils.ClickTagger;
  2.  
  3. var fallback1:String = "http://www.jasonfincanon.com";
  4. var fallback2:String = "http://www.flashinyourface.com";
  5. var fallback3:String = "http://www.adobe.com";
  6.  
  7. var clickTagger:ClickTagger = new ClickTagger(stage.loaderInfo);
  8. clickTagger.assignClickTag(button1,fallback1,1);
  9. clickTagger.assignClickTag(button2,fallback2,2);
  10. clickTagger.assignClickTag(button3,fallback3,3);

I hope this helps you in your Flash advertising development and please don't hesitate to let me know if you come across any bugs.

Changelog

  • 02-14-2010
    - Added a security check for "http://" or "https://" in the clicktag if the swf is being viewed in a browser. If the security test fails, the fallback url is used.

*Download ClickTagger here*


Comments (3) Trackbacks (0)
  1. Very nice class, now if only 3rd party tracking will allow player 9.

  2. Thanks Bodie! It’s too bad that they lag behind like they do, but I think there are a few here and there that can be convinced if asked. Hopefully the number of them will start to increase soon.

  3. Thanks for this! It s about time we start using the privileges of AS3 in the banner campaign field.


Leave a comment


*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Trackbacks are disabled.