5 Replies Latest reply on Jan 23, 2011 7:35 PM by kglad

    navigate to a pdf file

    gross770 Level 1

      Hi

      would someone have the code necessary to navigate to a pdf file if its possilbe?

       

      Here is some suggested code but it doesn't work.

       

      pdfDoc.addEventListener(MouseEvent.CLICK, goToPdfDoc);

       

      function goToPdfDoc(event:MouseEvent):void
      {
          navigateToURL(getURL("mydoc.pdf"), "_self");

      }

        • 1. Re: navigate to a pdf file
          kglad Adobe Community Professional & MVP

          who suggested that mix of as2 and as3 that is hopelessly wrong???

           

          if you're using as3, try:

           

           

           

          pdfDoc.addEventListener(MouseEvent.CLICK, goToPdfDoc);

           

          function goToPdfDoc(event:MouseEvent):void
          {
              navigateToURL(new URLRequest("mydoc.pdf"), "_self");

          }

          • 2. Re: navigate to a pdf file
            gross770 Level 1

            That's great it actually worked! Thankyou

             

            I also having challenges with buttonMode.  With one movie clip the buttonMode worked allowing me to hover my mouse over the button and it turned in to a hand but it didn't work for my othe movie clip and doesn't turn in to a  hand.  I'm also having probs with navigating to a url that is a html file on my local disk drive on  my computer it just stays frozen and doesn't move when I click on the button to move to my home screen.  I think it has to do with my security but I'm not sure.  I'm using firefox.

             

            best regards,

            Aron

            • 3. Re: navigate to a pdf file
              kglad Adobe Community Professional & MVP

              1.  copy and paste the buttonMode code that's problematic.

               

              2.  use http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04a.ht ml to adjust your security settings.

               

              3.  open new threads for new topics.

              1 person found this helpful
              • 4. Re: navigate to a pdf file
                gross770 Level 1

                Thanks Kglad,

                you have solved my problem again.  I just read the documentation on the link you gave me and it was simple to fix after that.  In the global settings I just put in the exact path of the the folder to where my files are kept and now I can call my files perfectly.  In regards to the other problem of the buttonMode not working properly - it wasn't working properly because I had the text set to selectable and I changed it to read only and its fixed.

                 

                Thanks again,

                best regards,

                Aron

                • 5. Re: navigate to a pdf file
                  kglad Adobe Community Professional & MVP

                  you're welcome.