Hi im new to AS3 and am having some trouble converting some code from AS2…
here is my AS2 code;
on (release) {
if (_level0.linkTag.substr(0,5) == "http:")
getURL(_level0.linkTag,_level0.targetTag);
else
getURL("http://www.mydomainname.com","_blank");
}
here is my AS3 code that does not work;
function myButtonAction(eventObject:MouseEvent) {
if (_level0.linkTag.substr(0,5) == "http:") {
var url:String = _level0.linkTag;
var request:URLRequest = new URLRequest(url);
navigateToURL(request, _level0.targetTag);
}
else {
var url:String = " http://www.mydomainname.com";
var request:URLRequest = new URLRequest(url);
navigateToURL(request, '_blank');
}
}
buttonLink.addEventListener(MouseEvent.CLICK,myButtonAction);
Any help with this would be much appreciated!!!:beam: