PDA

View Full Version : AS3 Image Map Linking Issue - No compiler errors



srawr42
April 9th, 2009, 05:26 PM
Hello,

I've made an image map in Flash using AS3, however it does not seem to be working properly.
The links only work in a strange succession. In order to click all the links you must first click the last link followed by the first link, then the second link. After that the image map behaves as it is supposed to. I'm not sure why this is happening.
It complies without error and aside from the little quirk mentioned above, it works beautifully.
I've checked and double checked the AS, even copied and pasted some code from one button to another to see if it would make a difference, but to no avail.
I am using the code listed below:


button1.addEventListener(MouseEvent.CLICK, callLink1);



function callLink1 (event: MouseEvent) :void {
var url:String = ("http://www.google.com");
var request:URLRequest = new URLRequest (url);
try
{
navigateToURL (request, "_parent");
}
catch (e:Error) {
trace ("Error occurred!");
}



Any and all help would be much appreciated, thank you!

IQAndreas
April 10th, 2009, 10:56 AM
That code should work just fine (other than you are missing another right curly bracket at the end), and my guess is that there is some problem somewhere else in the code.

Try posting the full code (or PM it to me if you don't want to make it public) and I will take a look at it.