Banner ad with getURL function

Hello! Haven’t posted in a long time, good to be back.

Having problems with a banner ad that needs to be clickable. The client sends me an email that reads like this:

The creatives look ok and are in spec, but are not clickable. Here is a suggestion from Google about fixing that issue:

There is no button action defined in the creative. Creative developer will need to add an invisible button over the area of the creative that should be clickable, or turn a symbol into a button (or movie clip) and associate the below ActionScript code to it.

on(release){

getURL(_level0.clickTag, "_blank");}

Hopefully that helps."

So, I made a movie clip, added that code to it, it doesn’t do what I needed it to do, so I switched it back to AS1/2 and tried this:

on (rollOver) {
//do this
}
on (rollOut) {
//do this
}
on (release){
getURL(“http://www.delawaretire.com”,"_self");
}

anyhow, getURL isn’t getting anything when I preview the SWF in firefox or Chrome. It looks like you can click on it, but doing so doesn’t open the URL in a new window.

If anyone cares to help me out with this, I’d be immensely appreciative. Thanks in advance!

Nevermind, got it sorted. This worked. Thanks anyhow!

invisible_btn.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);

function mouseDownHandler(event:MouseEvent):void {

navigateToURL(new URLRequest(“http://www.flashexplained.com/”));

}

Have you not switched to HTML5 banners?

Nope, not yet. I even tried doing these banners in HTML5, they looked great were the right file size and everything. The Client came back and demanded SWFs.

Now they’re telling me that I HAVE to do this via the AS3 ClickTag method, and I’m at a loss.

What’s the proper syntax for this?

on(release){

getURL(_level0.clickTag, “_blank”);}

When I put the URL before hand, it gives me a syntax error. When I put the URL in parentheses before the “_level0.Clicktag” bit, it gives me a syntax errror too.

That is an AS2 clickTag but to be perfectly honest that is the version I only saw associated with Cars.com

There is no reason why AS2 SWFs won’t still play, however no version of Flash past Flash CS6 can output AS2, and Flash CC exports a Flash player version higher than what the ad software companies take.

I would ask for direct communication with the vendor serving the ads, which might be Doubleclick, or not.

What you had above AS3 has no clickTag, so it might be:

invisible_btn.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);

function mouseDownHandler(event:MouseEvent):void {

navigateToURL(new URLRequest(“clickTag”));

}

Because URLs are added in ad software and are dynamically assigned.

Awesome, thanks! I’ll give it a shot. Might not hear back about it until Monday. Thank you!

I read this. I still don’t think I quite understand what, exactly, a clicktag is.

http://www.surfline.com/advertising/surfline_ad_specs/guide_to_clicktag_122710.pdf

Hey Dan! I have no useful information for you, just wanted to say hi.

1 Like

Never heard of that vendor. Case matters, so it looks like this vendor uses clickTAG rather than clickTag
The actual URL is served dynamically by the ad software.

Create a button, give it an instance name of my_button

Create a keyframe on a new layer and paste

var _url:String = “”;
if (LoaderInfo(root.loaderInfo).parameters.clickTAG)
{ _url = LoaderInfo(root.loaderInfo).parameters.clickTAG;
my_button.addEventListener(MouseEvent.MOUSE_UP, handleMouse);
}

function handleMouse(event:MouseEvent):void
{ navigateToURL(new URLRequest(_url), “_blank”); }