I got this clicktag but it does not work:
MyClickTagButton.addEventListener(
MouseEvent.CLICK,
function():void {
if (root.loaderInfo.parameters.clickTAG.substr(0,5) == "http:") {
navigateToURL(
new URLRequest(root.loaderInfo.parameters.clickTAG), "_blank"
);
}
}
);
When I click it I get this error:
TypeError: Error #1010: A term is undefined and has no properties.
at Function/< anonymous >()
Using anonymous functions as event handlers is a bad practice…
Secondly, do your button has an instance name
MyClickTagButton
? If not you either has to change its instance name either alter the code to match existing instance name.Ah, and the last thing: when you test it in the standalone player the clickTAG parameter is not set, so probably nothing will happen when you click the button.