Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


Im trying to create a button that opens/closes a picture

New Here ,
Aug 10, 2021 Aug 10, 2021

Copy link to clipboard

Copied

I have an architectural floor plan that I would like to add buttons to that open/close different elevations (pics) throughout the project. I want each button to open/close its own corresponding picture.

TOPICS
How to

Views

34

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 10, 2021 Aug 10, 2021

Copy link to clipboard

Copied

Im currently using Acrobat XI

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Aug 10, 2021 Aug 10, 2021

Copy link to clipboard

Copied

You can use image field to add image and then use script in button to show/hide that field.

As Mouse UP event of button add this and replace picture field name to your field name:

if(this.getField("Picture_af_image").display == display.visible)
this.getField("Picture_af_image").display = display.hidden;
else this.getField("Picture_af_image").display = display.visible;

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 10, 2021 Aug 10, 2021

Copy link to clipboard

Copied

Thanks for your response. However, Im am brand new to scripting and unfamiliar with this process.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Aug 10, 2021 Aug 10, 2021

Copy link to clipboard

Copied

LATEST

You have everything you need above. You just need to change the field name, between the quotes.

To make it a bit more compact, and so that you only have to enter the field name once, use this version of that code:

 

// Change "Picture_af_image" below to the name of your actual field
var imageFieldName = "Picture_af_image"; 
var f = this.getField(imageFieldName);
if(f.display == display.visible)
f.display = display.hidden;
else f.display = display.visible;

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines