clickTag in Actionscript 3.0

I’ve never used AS3 before, and I have to add a “clickTag” to an online ad for tracking purposes. I get an error #1009 (Cannot access a property or method of a null object reference).
Here’s my code so far:

var _url:String = “”;
if (LoaderInfo(root.loaderInfo).parameters.clickTag)

function():void {
if (root.loaderInfo.parameters.clickTag.substr(0,5)==“http:”) {
new URLRequest(root.loaderInfo.parameters.clickTag),

This is all greek to me. Does someone know where I’m missing this key bit of code?