How do I check if an swf flash file implements clickTAG?

6.9k Views Asked by At

We've been developing an affiliate system and would like to detect somehow that a compiled, SWF advert implements clickTAG or not. Is there any way to automate this process?

5

There are 5 best solutions below

1
On

When I debug flash banners I use flasm (http://www.nowrap.de/flasm.html windows+linux) to decompile the swf file. You can both get output to console (-d) or dump it to a file:

$ flasm -d file.swf > out.txt

Then search the file/output for clickTag/clickTAG.

  • Requires exec privileges.
0
On

This is a complex problem.

The suggested solution only addresses the case of an incorrect clicktag (e.g. clickTAG vs clickTag). Here are other potential problems: - no clickable layer, no clicktag code - clickable layer with hard-coded URL - clickable layer only covering a small portion of the banner - All of the above in AS3 (flasm only supports AS2)

0
On

If I've understood correctly what you need to do, it should be possible to build a semiautomated testing swf by loading the ad, then simulating clicks on everything in its display tree.

You can pass parameters to a loaded swf using the data property of a URLRequest like so:

var loader:Loader = new Loader();
var req:URLRequest = new URLRequest("ad.swf");
var clickTagURL:String = "http://www.example.com";
req.data = new URLVariables("clickTAG=" + clickTagURL + "&clickTag=" + clickTagURL + "&clicktag=" + clickTagURL);
loader.load(req);

(Though you'll need to run that in a browser or standalone as the Flash IDE complains about query string parameters.)

Then you can step recursively through the display list triggering clicks:

testClicks(loader.content as DisplayObjectContainer);

function testClicks(target:DisplayObjectContainer):void {
    var numC:uint = target.numChildren;
    for (var i:uint = 0; i < numC; i++) {

        target.getChildAt(i).dispatchEvent(new MouseEvent(MouseEvent.CLICK));

        if (target.getChildAt(i) is DisplayObjectContainer) {
            testClicks(target.getChildAt(i) as DisplayObjectContainer);
        }
    }
}

If you set the folder with your test ad as trusted, or use the debug player, you'll be able to see if any of those clicks cause the ad to open a URL.

It's probably worth triggering MOUSE_DOWN and MOUSE_UP too in case the developer has used those instead, and obviously this won't reveal problems like very small click areas as jdangu mentions, but hopefully it's useful as a basic test.

0
On

http://adopstools.net lets you submit a swf and check it for clicktags as well as other things

0
On

You can use a clicktag checker like www.adbannerking.com It will reveal the clicktag that is in the SWF file. The software even allows you to change the clicktag accordingly without the need of the source files (.fla). At the same time you can check / change x amount of SWF files at the same time quickly.