Okay this unholy mishmash of AS3 and CreateJS APIs needs to stop. This works, assuming the "buttons" are actually movieclips pretending to be buttons: this.stop(); // required only if no actual buttons are used stage.enableMouseOver(20); // variables var numButtons = 7; var i, b, curButton; // initialize for (i = 1; i <= numButtons; i++) { b = this["button" + i]; b.cursor = "pointer"; b.mouseChildren = false; b.addEventListener("click", buttonClickHandler.bind(b)); b.addEventListener("mouseover", buttonRollOverHandler.bind(b)); b.addEventListener("mouseout", buttonRollOutHandler.bind(b)); } // event handlers function buttonClickHandler() { if (curButton) { curButton.gotoAndStop(0); } this.gotoAndStop(2); curButton = this; } function buttonRollOverHandler() { if (this != curButton) { this.gotoAndStop(1); } } function buttonRollOutHandler() { if (this != curButton) { this.gotoAndStop(0); } }
... View more