Skip to main content
Known Participant
November 25, 2018
Question

how can I create a colour changing click button that will work in PDF reader? say original colour blue, click it, changes to green....

  • November 25, 2018
  • 1 reply
  • 13613 views

I am currently working on an interactive ebook......I want to add a click button to

the bottom of each page that will change colour from blue to green if it is clicked on..

I am using publisher to create the book and then saving it as PDF.

    This topic has been closed for replies.

    1 reply

    try67
    Adobe Expert
    November 26, 2018

    For future questions about scripts in PDF files you should really use this forum: JavaScript

    Regarding your question: Do you want it to change only once, or back and forth with each click?

    If only once then set the fill color as blue and then apply the following JavaScript code as the MouseUp event of the button:

    event.target.fillColor = color.green;

    If you want it to change back and forth, use this code:

    event.target.fillColor = (color.equal(color.blue, event.target.fillColor)) ? color.green : color.blue;

    Known Participant
    November 27, 2018

    Thank you try67

    sorry about the wrong forum but I am totally new to this kind of thing.......

    the script you have provided, which software can that be used in? I am using publisher for my project

    and then converting it to PDF.

    again thank you for help and I am sorry for my simple questions.

    Stephen

    Known Participant
    November 28, 2018

    The script I provided can be applied using Adobe Acrobat.

    On Tue, 27 Nov 2018 at 11:26, stephenc22263337 <forums_noreply@adobe.com>


    try67

    many thanks as that has worked well for me once I downloaded Acrobat..

    Thank you for your help, I hope you dont mind but I have one more question.

    Can I use javascript to select certain words and then have them appear on another page?

    regards

    Stephen