Copy link to clipboard
Copied
I have created a PDF with five buttons over different text to reveal a message for each with a mouse-over. The messages are in layers ("Layer2" through "Layer6"), and I found a script from another thread to add to the Mouse Enter and Mouse Exit actions for each button. But the script does not perform any action or produce any errors when I view it in the debugger. My script below is an example of Mouse Enter for Layer2. The "ocgArray1[i].state = false" for Mouse Exit. Any help would be greatly appreciated.
var ocgs = this.getOCGs() ;
var ocgArray1 = this.getOCGs();
for (var i=5; i < ocgArray1.length; i++) {
if (ocgArray1[i].name == "Layer2") {
ocgArray1[i].state = true;
}
}
Copy link to clipboard
Copied
Why are you starting the loop from 5, instead of 0?
Copy link to clipboard
Copied
Why are you starting the loop from 5, instead of 0?
Copy link to clipboard
Copied
Thank you for pointing that out, Try67! I wondered about that from the example in the discussion I pulled this from but tried it out. When I changed it to zero, it worked.

