1 Replies - 1788 Views - Last Post: 28 September 2009 - 02:44 AM

#1 amaray  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 22-September 09

open a pdf

Post icon  Posted 27 September 2009 - 05:14 PM

I'm trying to open a .pdf file by using a button in Actionscript 3. When searching the web on how to do this I kept coming across the getURL code that is used in Actionscript 2.

function pdfresume(event:MouseEvent):void
{
var targetURL:URLRequest = new
URLRequest("amarayresume.pdf")
;
navigateToURL (targetURL);
}
pdfresume.addEventListener(MouseEvent.CLICK,pdfresume);



I keep getting the error Scene1, Layer 'actions', Frame 1
function pdfresume(event:MouseEvent):void

and it says that 2 times reports 4 errors.

I can't get the .pdf in my library, everytime I try to import it the program won't let me import the file so is there a way to have the button go to the external file of my resume? Thanks for any help!!!

Is This A Good Question/Topic? 0
  • +

Replies To: open a pdf

#2 thehat  Icon User is offline

  • awake ? web();
  • member icon

Reputation: 106
  • View blog
  • Posts: 951
  • Joined: 28-February 08

Re: open a pdf

Posted 28 September 2009 - 02:44 AM

You can't make the instance name of your button the same as the name of the function. Try setting the instance name of your button to something different, like resume_but.

resume_but.addEventListener(MouseEvent.CLICK,pdfresume);


Was This Post Helpful? 1

Page 1 of 1