question about pdf loading
I am making a SWF with a menu to load a list of PDFs. My code is giving me issues. I have two PDFs in the list and when I click each they both load the same thing even though they are calling to different files and they are both different buttons with different instances. Here is my code:
hammer_crusher_load.addEventListener(MouseEvent.CLICK, goPDF);
crush_retro_load.addEventListener(MouseEvent.CLICK, goPDF);
function goPDF(event:MouseEvent):void
{
var url:String = "Brochures/Crushing/EVHammerImpactCrusherlowres.pdf";
var url:String = "Brochures/Crushing/EVcrusherretrofit.pdf";
var request:URLRequest = new URLRequest(url);
navigateToURL(request);
}
When I test the SWF I get this error:
Scene 1, Layer 'Actions', Frame 10, Line 7 Warning 3596: Duplicate variable definition.
I dont know how else to write this. If someone could show me what I am doing wrong I would appreciate it. Thanks.
the second bit of code i have tried that still wont work right is:
hammer_crusher_load.addEventListener(MouseEvent.CLICK, goPDF);
function goPDF(event:MouseEvent):void
{
var url:String = "Brochures/Crushing/EVHammerImpactCrusherlowres.pdf";
var request:URLRequest = new URLRequest(url);
navigateToURL(request);
}
crush_retro_load.addEventListener(MouseEvent.CLICK, goPDF);
{
var url:String = "Brochures/Crushing/EVcrusherretrofit.pdf";
var request:URLRequest = new URLRequest(url);
navigateToURL(request);
}
