# Banner ad with getURL function

**URL:** https://forum.kirupa.com/t/banner-ad-with-geturl-function/634044
**Category:** Uncategorized
**Created:** [December 10, 2015, 11:37pm UTC](https://forum.kirupa.com/t/banner-ad-with-geturl-function/634044 "2015-12-10T23:37:36Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![DanontheMoon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/danonthemoon/32/7436_2.png) [@DanontheMoon](https://forum.kirupa.com/u/DanontheMoon)
#### Post date: [December 10, 2015, 11:37pm UTC](https://forum.kirupa.com/t/banner-ad-with-geturl-function/634044/1 "2015-12-10T23:37:36Z")

</div>

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](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!

---

<div class="post-metadata">

### Author: ![DanontheMoon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/danonthemoon/32/7436_2.png) [@DanontheMoon](https://forum.kirupa.com/u/DanontheMoon)
#### Post date: [December 11, 2015, 2:27am UTC](https://forum.kirupa.com/t/banner-ad-with-geturl-function/634044/2 "2015-12-11T02:27:35Z")

</div>

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/](http://www.flashexplained.com/)”));

}

---

<div class="post-metadata">

### Author: ![somnamblstt](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/somnamblstt/32/7288_2.png) [@somnamblstt](https://forum.kirupa.com/u/somnamblstt)
#### Post date: [December 11, 2015, 2:19pm UTC](https://forum.kirupa.com/t/banner-ad-with-geturl-function/634044/3 "2015-12-11T14:19:05Z")

</div>

Have you not switched to HTML5 banners?

---

<div class="post-metadata">

### Author: ![DanontheMoon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/danonthemoon/32/7436_2.png) [@DanontheMoon](https://forum.kirupa.com/u/DanontheMoon)
#### Post date: [December 11, 2015, 9:02pm UTC](https://forum.kirupa.com/t/banner-ad-with-geturl-function/634044/4 "2015-12-11T21:02:26Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![DanontheMoon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/danonthemoon/32/7436_2.png) [@DanontheMoon](https://forum.kirupa.com/u/DanontheMoon)
#### Post date: [December 11, 2015, 9:07pm UTC](https://forum.kirupa.com/t/banner-ad-with-geturl-function/634044/5 "2015-12-11T21:07:10Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![somnamblstt](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/somnamblstt/32/7288_2.png) [@somnamblstt](https://forum.kirupa.com/u/somnamblstt)
#### Post date: [December 11, 2015, 9:29pm UTC](https://forum.kirupa.com/t/banner-ad-with-geturl-function/634044/6 "2015-12-11T21:29:05Z")

</div>

That is an AS2 clickTag but to be perfectly honest that is the version I only saw associated with [Cars.com](http://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.

---

<div class="post-metadata">

### Author: ![DanontheMoon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/danonthemoon/32/7436_2.png) [@DanontheMoon](https://forum.kirupa.com/u/DanontheMoon)
#### Post date: [December 12, 2015, 2:55am UTC](https://forum.kirupa.com/t/banner-ad-with-geturl-function/634044/7 "2015-12-12T02:55:14Z")

</div>

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

---

<div class="post-metadata">

### Author: ![DanontheMoon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/danonthemoon/32/7436_2.png) [@DanontheMoon](https://forum.kirupa.com/u/DanontheMoon)
#### Post date: [December 12, 2015, 8:23am UTC](https://forum.kirupa.com/t/banner-ad-with-geturl-function/634044/8 "2015-12-12T08:23:52Z")

</div>

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](http://www.surfline.com/advertising/surfline_ad_specs/guide_to_clicktag_122710.pdf)

---

<div class="post-metadata">

### Author: ![TheCanadian](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@TheCanadian](https://forum.kirupa.com/u/TheCanadian)
#### Post date: [December 14, 2015, 1:53am UTC](https://forum.kirupa.com/t/banner-ad-with-geturl-function/634044/9 "2015-12-14T01:53:38Z")

</div>

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

---

<div class="post-metadata">

### Author: ![somnamblstt](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/somnamblstt/32/7288_2.png) [@somnamblstt](https://forum.kirupa.com/u/somnamblstt)
#### Post date: [December 14, 2015, 9:53pm UTC](https://forum.kirupa.com/t/banner-ad-with-geturl-function/634044/10 "2015-12-14T21:53:01Z")

</div>

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”); }
