Copy link to clipboard
Copied
I submitted a couple of flash ad banners for a Google ad campaign and the clickTag code they gave me looks like it's for AS2 as it applies the code to an object:
(http://adwords.google.com/support/aw/bin/answer.py?hl=en&answer=26938)
on (release) {
getURL(clickTAG, "_blank");
}
I found somewhere some appropriate AS3 code but Google rejected that too. So does anyone know what the proper code is that will satisfy Google?
GF
Copy link to clipboard
Copied
This should do that (given you code on timeline):
var flashVars:Object = this.root.loaderInfo.parameters;
button.addEventListener(MouseEvent.CLICK, openClickTag);
function openClickTag(evtObj:MouseEvent):void {
navigateToURL(new URLRequest(flashVars["clickTag"]), "_blank");
}
Copy link to clipboard
Copied
Actually I'm getting (or Google is getting) an error still. I made the bg a mc and gave it an instance name that I referenced in your code. I attached to the first frame.
????
GF
BTW:. thanks.
Copy link to clipboard
Copied
I believe the var name is case-sensitive. It should be clickTAG.
navigateToURL(new URLRequest(flashVars["clickTAG"]), "_blank");
Copy link to clipboard
Copied
navigateToURL(new URLRequest(flashVars["clickTAG"]), "_blank");
Right...
Actually I also think one should enclose it into try/catch or check for this variable availability.
Copy link to clipboard
Copied
still not working. I want to run my (your) code by you to make sure I'm not doing something simply stupid.
on the first frame of the timeline I have AS:
import flash.events.TimerEvent;
import flash.utils.Timer;
var flashVars:Object = this.root.loaderInfo.parameters;
bg_mc.addEventListener(MouseEvent.CLICK, openClickTag);
function openClickTag(evtObj:MouseEvent):void {
navigateToURL(new URLRequest(flashVars["clickTAG"]), "_blank");
}
I have "bg_mc" as a MC instance name of the background image (it is a movie clip) for my animation so it acts like a button the size of the whole thing. there is a timer working on the last frame of the timeline.
See anything wrong?
GF
Copy link to clipboard
Copied
What is not working?
Copy link to clipboard
Copied
Google ads says in bold red text "Flash must support clickTAG" when my Ads guy submits it.
GF
Copy link to clipboard
Copied
Also, does bg_mc cover all the frames? Is it on the top of all the objects?
Copy link to clipboard
Copied
I made a new MC and made it transparent on the first frame above all layers except the actions layer, and lasting to the last frame. I gave it an instance name of "clicktag", so code now goes like this:
var flashVars:Object = this.root.loaderInfo.parameters;
clicktag.addEventListener(MouseEvent.CLICK, openClickTag);
function openClickTag(evtObj:MouseEvent):void {
navigateToURL(new URLRequest(flashVars["clickTAG"]), "_blank");
}
Incidentally, I found other code and tried it to no avail. It went like this:
var paramList:Object = this.root.loaderInfo.parameters;
clicktag.addEventListener(MouseEvent.CLICK, openURL);
function openURL(evtObj:MouseEvent):void {
var request:URLRequest = new URLRequest(paramList["clickTag"]);
navigateToURL(request, "_blank");
}
It also didn't work. And Google is no help whatsoever.
GF
Copy link to clipboard
Copied
You should probably post this question on DoubleClick forum (DoubleClick belongs to Google):
http://www.google.com/support/forum/p/dfp?utm_source=gam_forum&utm_medium=et&utm_campaign=gam_forum
Copy link to clipboard
Copied
I just went and created my animations in AS2 using the Google code for clickTAG. I did it in Flash CS5. It all went fine. It worked. What a waste of time messing with Google.
Thanks for the help.
GF
Copy link to clipboard
Copied
>
>
>
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.851 / Virus Database: 271.1.1/3083 - Release Date: 08/20/10 01:35:00
>
actually I showed a page I arrived at from this link to my Google guy
and he said we're using Google adwords and not DFP small business. I saw
something on the DFP Small Business site that said I can turn off the
need for clickTAG altogether when I upload content. I'm not sure what
the relationship is between them, but for now I'm sticking with AS2.
that seemed to work for me.
GF
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more