Code to hide multiple pop-ups at a time

Problem: I have 3 buttons on a page. All three buttons open 1 pop-up box each on clicking respective button. At a time I need to show only one pop-up.
Example: A, B, C are buttons. and 1,2,3 are popups. If I click A, popup 1 will be shown. at the same time, popups 2 and 3 will be hidden if already open. Now, what I have to do is add following:
For button A, show popup 1, hide pop-up 2, hide popup 3. Similarly, these things are required for button B and C. Is there any way where I can use toggle kind of function which will only show pop-up for the button I clicked. rest all pop-ups will be hidden. With my limited programming knowledge, I can’t think of anything.

ActivePresenter Version: 8

OS: WIN10

Hi Shri,

There is no need to use code to achieve what you want.
In the Events - Actions section of the button A/B/C, you will set events - actions as in the following image:
image
You can take look at the attached project for your reference:
Hide Multiple Pop-ups.approj (260 KB)
If you need further instruction, kindly let me know.
Yen

Regards,

Hi,
Thanks for quick solution and file. I have used the same technique throughout the document. The problem is I have about 350 slides. In about 15-20 slides, I have 25 such pop-ups on same slide. For this I have to set show/hide so many times. Can there be faster way you can suggest? In review cycles and product updates, number of pop-ups increase or decrease and it takes lot of time to check every slide.

Thank you.

Hi Shri,

Could you please share your project and its external data folder named PROJECT_FILE_files if any to support@atomisystems.com so we can take a look at it?

If these files are large, you can upload them to a cloud storage site like Google Drive then email to us.

Regards,
Yen

I’m sorry. Sharing the entire file will not be possible due to confidentiality reason. The request I want to make it is - If I gave 3 groups of pop-up boxes, there should be a command to keep all pop-boxes hidden unless clicked. Any toggle kind of mechanism should work. If you can help me with the JavaScript for such thing, it will not only help me but all users. Thanks!

Hi Shri,

Please take a look at the attached project for your reference:
multi popups.approj (284 KB).

To view Javascript code, click ActivePresenter button > Project > Properties > Event.
In the On Load event of a slide, add Execute Javascript action as in the following image:
2020_07_07_09_46_37_Window

Besides, kindly be reminded that you need to rename all buttons/ pop-ups following the same format: prefix_number
For example, Button_1/2/3/4… Popup_1/2/3/4…
2020_07_07_09_46_57_Window

Regards,

Thank you so much. It will ease my life very much.