Multiple toggling switches

How could I modify the javascript to have one object trigger the toggle of another object? Click on one button to hide or show other object?

The basic method would be:

  1. Add a way to reference the element you want toggled; the simplest is a Unique Element ID in the Identity Inspector. Iā€™m calling mine ā€œmyotherobjectā€
  2. Add a Mouse Down (or other event) handler on the the triggering element that is set to Run JavaScript, and add a function with code that looks like:
var otherElement = hypeDocument.getElementById("myotherobject");
var currentOpacity = hypeDocument.getElementProperty(otherElement, "opacity");
if(currentOpacity >= 1.0) {
    hypeDocument.setElementProperty(otherElement, "opacity", 0.0);
} else {
    hypeDocument.setElementProperty(otherElement, "opacity", 1.0);
}