Skip to main content
Participant
September 10, 2013
Answered

Google click tags

  • September 10, 2013
  • 2 replies
  • 1638 views

Hi People,

Working on some flash banners that i need to run on google.

Im having issues embedding the google click tag code.

Im using flash cs3 (action script 3).

This is the error message i keep getting after having placed the clicktag

TypeError: Error #2007: Parameter url must be non-null.

          at global/flash.net::navigateToURL()

          at Function/<anonymous>()

Your assistance will be hihly appreciated.

This topic has been closed for replies.
Correct answer Ned Murphy

The code will work but it somewhat defeats the intention of the clickTag parameter.

I don't see where you used a variable named "url" in the original code, but the portion of the code that reads:

     root.loaderInfo.parameters.clickTAG

is a parameter that gets assigned in the swf embedding code of the html page.  The swf file reads it in usign that line of Actionscript code.  It defines the url that gets used for the clickTag link, and allows whoever to update it without having to modify the swf file.  The way you have it now would require editing to create a new swf file.

2 replies

kglad
Community Expert
Community Expert
September 10, 2013

you probably forgot to surround the url with quotes.  ie, that should be a string, not an undefined variable in the new URLRequest().

Ned Murphy
Legend
September 10, 2013

The error is indicating that a variable you have named "url" is coming up null.

Participant
September 10, 2013

Hey thanks for this, below is the code i was using....

import flash.events.MouseEvent;

import flash.net.URLRequest;

// ......

gbutton.addEventListener(

   MouseEvent.CLICK,

   function(event: MouseEvent) : void {

  flash.net.navigateToURL(new URLRequest( root.loaderInfo.parameters.clickTAG), "_blank");

     }

   );

--------------------END---------------

So i amended the code to:

import flash.events.MouseEvent;

import flash.net.URLRequest;

// ......

gbutton.addEventListener(

   MouseEvent.CLICK,

   function(event: MouseEvent) : void {

  flash.net.navigateToURL(new URLRequest( "http://www.domain-name.com"), "_blank");

     }

   );

-----------------------------------

The above code works. Do u think i need to add anything else?

Ned Murphy
Ned MurphyCorrect answer
Legend
September 10, 2013

The code will work but it somewhat defeats the intention of the clickTag parameter.

I don't see where you used a variable named "url" in the original code, but the portion of the code that reads:

     root.loaderInfo.parameters.clickTAG

is a parameter that gets assigned in the swf embedding code of the html page.  The swf file reads it in usign that line of Actionscript code.  It defines the url that gets used for the clickTag link, and allows whoever to update it without having to modify the swf file.  The way you have it now would require editing to create a new swf file.