Hi,
I’m trying to make a set of buttons within a holder MC go to various links on a webpage
button1.addEventListener(MouseEvent.CLICK, onMouseClick, false, 0, true);button1.name = "http://www.hyundai-car.co.uk/testDrive/";button2.addEventListener(MouseEvent.CLICK, onMouseClick, false, 0, true);button2.name = "http://www.hyundai-car.co.uk/brochures/";
button3.addEventListener(MouseEvent.CLICK, onMouseClick, false, 0, true);button3.name = "http://www.hyundaiapproved.co.uk/";
button4.addEventListener(MouseEvent.CLICK, onMouseClick, false, 0, true);button4.name = "http://www.hyundai-car.co.uk/contact/";
button5.addEventListener(MouseEvent.CLICK, onMouseClick, false, 0, true);button5.name = "http://www.hyundai-car.co.uk/newCars/";
function onMouseClick(event:MouseEvent):void
{
trace("clicked");
// var req:URLRequest = new URLRequest(evt.currentTarget.name);
// navigateToURL(req, "_self"); // this opens the URL in the same flash tab
// navigateToURL(req, "_blank"); //this opens a new browser tab
}
This is my code at the moment, does anyone know why it’s not working?
Thanks in Advance
sorry i should add that only button one displays the “Clicked” trace