Copy link to clipboard
Copied
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")
}
}
To check if parameter exists.
Copy link to clipboard
Copied
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")
}
}
Copy link to clipboard
Copied
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 &&?
Copy link to clipboard
Copied
To check if parameter exists.
Copy link to clipboard
Copied
Thanks for the help!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now