Skip to main content
Known Participant
August 31, 2010
Answered

ClickTag issues!

  • August 31, 2010
  • 2 replies
  • 1445 views

I'm getting an error thrown...

TypeError: Error #1009: Cannot access a property or method of a null object reference.

It's dealing with enter_mc .. What could be the problem here?

import com.greensock.*;

import flash.events.*;

enter_mc.addEventListener(MouseEvent.CLICK, goThere);

function goThere(e:MouseEvent)

{

if (root.loaderInfo.parameters.clicktag.substr(0,5)=="http:")

{

navigateToURL(new URLRequest(root.loaderInfo.parameters.clicktag), "_blank");

trace("clicked")

}

}

This topic has been closed for replies.
Correct answer Andrei1-bKoviI

To check if parameter exists.


2 replies

Known Participant
August 31, 2010

Thanks for the help!

Inspiring
August 31, 2010

It is case sensitive. I believe it is clickTag.

Also, you should check for its existence:

function goThere(e:MouseEvent)
{
     if (root.loaderInfo.parameters.clickTag && root.loaderInfo.parameters.clickTag.substr(0,5)=="http:")
     {
          navigateToURL(new URLRequest(root.loaderInfo.parameters.clickTag), "_blank");
          trace("clicked")
     }

}

Known Participant
August 31, 2010

 if (root.loaderInfo.parameters.clickTag && root.loaderInfo.parameters.clickTag.substr(0,5)=="http:")

In this line, what are the two different phrases use for between the &&?

Andrei1-bKoviICorrect answer
Inspiring
August 31, 2010

To check if parameter exists.