5 Replies Latest reply on Jun 26, 2009 11:23 AM by gkaiseril

    How do we hide/disable a Link?

    Ramon F Herrera Level 1

      I have tried:

       

        myLink.hidden = true;

        myLink.rect.hidden = true;

        myLink.borderColor = color.transparent;

       

      With the first two statements there is no complain, but they don't do anything (NOOP).

       

      With the 3rd. statement, it says:

       

      "InvalidSetError: Set not possible, invalid or unknown.".

       

      I then decided to use:

       

        myLink.hightlightMode = "None";

        myLink.hightlightMode = "Invert";

       

      but it seems to be another NOOP.

       

      -Ramon

        • 1. Re: How do we hide/disable a Link?
          Bernd Alheit Adobe Community Professional & MVP

          Did you read the JavaScript documentation?

          1 person found this helpful
          • 2. Re: How do we hide/disable a Link?
            Ramon F Herrera Level 1

            > Did you read the JavaScript documentation?

             

            Yes I did. I got the lines I just posted from the JavaScript documentation, which I have in front of me.

             

            I have the PDF (Version 8) and HTML (Version 9).

             

            However (and honestly), I prefer you to a book. Your explanations are much better, and succinct.

             

            The questions that I post here:

             

            (1) Remain in cyberspace for posterity (hello, readers from the future!, can you send me the winning lottery numbers? :-)

             

            (2) The Adobe documentation writers can take a look at my questions and your answers, to improve the docs.

             

            No offense, as an Usenet/Internet pioneer I just feel strongly about the tremendous value of this type of interaction.

             

            Anyway, back to business...

             

            My latest attempt was:

             

            myLink.borderWidth = 0;

            myLink.borderWidth = 1;

             

            The width of the border becomes invisible, but the rectangle is still there, and it attracks clicks.

             

            I suppose I could remove the link and create it again (the manual doesn't have an opinon on that). Perhaps I should resize the rectangle to [0,0,0,0]?

             

            Warmest and effusive thanks to everybody who participates here, specially the ones who answer questions.

             

            -Ramon

            • 3. Re: How do we hide/disable a Link?
              Bernd Alheit Adobe Community Professional & MVP

              You can remove the link with the method removeLinks. You can add links with the method addLink.

              1 person found this helpful
              • 4. Re: How do we hide/disable a Link?
                Ramon F Herrera Level 1

                Thanks Berndt!

                 

                My interest is to make a whole bunch of items appear/disappear when the user [un]clicks a check box.

                 

                I suppose I will have to save the link somewhere and add it later...

                 

                Regards,

                 

                -Ramon

                • 5. Re: How do we hide/disable a Link?
                  gkaiseril MVP & Adobe Community Professional

                  Not only do you need the Mozzilla JavaScript Reference, but you also need the Adobe Acrobat JavaScrpit API Reference which provides information about how JavaScript is implemented in Acrobat and the addition objects and methods specific to Acrobat forms and what is available by version and product.

                   

                  If your end users have Reader, you can not manipulate the link object in Reader.

                   

                  Then there is the problem of accessing the specific link object after creation. Not that easy. And there is no option to remove a single link by name, only by page and location within the page.

                   

                  It would be easier to create a form field (button) with the necessary action to execute the link ('app.launchURL("http://www.example.com/", true);')

                   

                   

                  , and then you can manipulate the form field's properties of 'displaly' (to hiide/show) and 'readonly' (to enable/disable) to manipulate the link.