Yeah, I'm a noob, simplest answer possible please. Thanks
Assign the objects instance names and use an event listener on the one you want to click and have its event handler function set the other's visible property to the opposite of what it is.
oneObject.addEventListener(MouseEvent.CLICK, toggleObject);
function toggleObject(evt:MouseEvent):void {
otherObject.visible = !otherObject.visible;
}
Both objects must be present at the same time.
is there anyway to do this without having both objects present. Lets say one keyframe has a button and another keyframe has a box(the box is not visible and the button is not present on this keyframe) . When the button is pressed on one keyframe the box appears on the other ( doesnt toggle between visible and not, once clicked always visible). or is this not possible?
You cannot directly affect an object that is in another frame (that is, the frame numbers are different).
You could have a variable that is defined in a layer that extends across the frames involved. You would set the value of that variable when you click the one object. In the frame where the other object is you use that variable to determine if the second object should be visible or not.
North America
Europe, Middle East and Africa
Asia Pacific