Hi, I have two objects: One is a button (instance name button1) and a square (instance name square1), and I would like the square's visibility to be toggled on or off when the button is clicked. So far, my code can make the square disappear, but not reappear. Below is my current code:
square1.visible = true;
button1.addEventListener(MouseEvent.MOUSE_UP, squareVisible);
function squareVisible (e:MouseEvent):void {
if (square1.visible = true){
square1.visible = false;
} else if (square1.visible = false){
square1.visible = true;
}
}
Thanks for your help! :)