Button state image swap in code

Hi there,

I am using hype buttons with a ‘normal’ and ‘pressed’ state as a play button. I would like to be able to swap the images for both states in code, so that when my audio file is playing, the play button images are replaced with pause button images. Is there a way to change the images for specific states for a hype button in code?

thanks!

Not using button states. Instead you’ll want to fashion your own buttons with On Mouse Down/On Mouse Up actions and have that invoke javascript to change the background via a call like:

hypeDocument.setElementProperty(element, "background-image", "${resourcesFolderName}/otherImage.png");