Keeping the pressed state down

Hi guys, I did make a presentation intending to use the the following logic:

In a slide I put 3 buttons. Each button is suppose to trigger the appearance of three different images. I know how to get that associated to the button. The problem I have is this… I want to be able to click, release the mouse and keep the button in the pressed state showing its correspondent image on canvas.
But unfortunately the button doesn’t stay pressed and when I release it, the image continues the correspondent one but the button goes back to the same state it was before (normal). How do I keep it pressed till the next button is pressed? Any tutorial showing this detail? Thanks ahead!

Hi Deni,

You can try using the radio button, make the toggle button invisible and change its states’ style same as a normal button state’s style.
So, please follow the instructions below to see if it meets your needs:

  • Insert radio button > Format tab > disable the Show Toggle Button > click the Change Shape button and select a shape (eg. Rounded Rectangle)
  • Adjust its style (Properties pane > Style & Effects tab)
  • Adjust its states’ style same as a button state’s style (View tab > Object States > Edit States)
    Learn how to work with Object State through this article: Work with Object States in ActivePresenter 8 - Atomi Systems, Inc.

For your reference, I attached a screenshot of my customization.

Regards,
Thuy

1 Like

Thanks Thuy, I’ll test it and let you know if it did work.

Hey Thuy, The problem remains… I need to be able to click a button (initially Yellow), and have its color changed (from yellow to green), then even if I take my mouse out of the button, it should remain green until I click button2. When I click on button2, button2 will be green, and button1 should be released from the color green, returning to its normal color (yellow). The mechanism should work independently of which order I press the buttons. Can you please send me an example, if it is possible?

Please take a quick look at this sample:
button-sample.approj (300 KB)

Thank you Thuy, I had already gotten this solution right before reading your post. Please take look on my approach to the problem. My conclusion was: The buttons had to be grouped together otherwise the toggle between themselves would not work. I developed a bit more using hover states and roll out events. But your solution is much simpler. My example has the appearing and disappearing of images based on the press of each button.
I’m going to put my example here case someone may need it.
Thank you so much.

toggle between btns_Sample.approj (656 KB)

1 Like

Glad to know that you find out the way to answer your own question, Deni :slightly_smiling_face:
But you don’t need to use the Change Object States action to achieve your wish.
When you group the radio buttons, a button will switch to its normal state once you click on another button.
I’ve fix your sample project to make everything simpler. You can check it here:
toggle between btns_Sample 1.approj (404 KB)

Have a nice weekend.

Thank you Thuy. Very generous of your part. I have one more question for today, if there’s time. Is there possible to control the visibility of objects through code? Ex: If I have two or more images appearing in the same location. Is there a way I can switch between the position among them? Example, getting the image A (from the top) and putting it to the back leaving image B as the top one. And consequently, changing the order of the several images in front of each other. Any ideas?

You can set zIndex to make the object appear on the top by using the following javaScript:

var topmostObject = prez.object('object name');
topmostObject.node.style.zIndex = 1;
if (prez.myTopmostObject)
	prez.myTopmostObject.node.style.zIndex = '';
prez.myTopmostObject = topmostObject;

BR,

1 Like

Thank you again…You guys Rock!