3 Replies Latest reply: Jun 17, 2013 6:12 AM by kglad RSS

    Button to open pdf file

    flashylee Community Member

      In Adoble Flash Professional CS6,

       

      I want to make a button that will open a pdf file - in Adobe reader

       

      Not sure if this is an issue, but I want the pdf to be opened on any computer, not just mine.. (where the pdf is located..) Is that possible?

       

      Any help would be great!

        • 1. Re: Button to open pdf file
          kglad CommunityMVP

          you can't control whether a user has adobe reader so, no it's not possible.

           

          however, if they have adobe reader and if it's their default pdf viewer you can do that using getURL (as2) or navigateToURL (as3).

          • 2. Re: Button to open pdf file
            flashylee Community Member

            I'll be presenting the game to an audience on a known computer, so I can ensure that adobe reader will be used.

             

            So I'm assuming I will then copy the pdf to that computer.. Will this change the code from when I make it on my computer?

             

            I really don't know how to use actionscript well, so in as3 what would the code be?

            • 3. Re: Button to open pdf file
              kglad CommunityMVP

              again, in as3, use navigateToURL.  if the pdf and the published html and swf are the same directory use:

               

              navigateToURL(new URLRequest("yourpdf.pdf"));