Switch
Code Actionscript 2.0
Instance action
on (press) {
// if invisible -> show
// and vice versa
if (_alpha == 0) {
_alpha = 100;
} else {
_alpha = 0;
}
}
Code Actionscript 3.0
square.addEventListener(MouseEvent.MOUSE_DOWN, press); function press(e:MouseEvent) { // if invisible -> show // and vice versa if (square.alpha == 0) { square.alpha = 1; } else { square.alpha = 0; } }
Description
The visibility of the square alternates on every mouse click.
related to: Dropdown-menu
Download
Right click: Flashfile AS 2.0 | Flashfile AS 3.0 | SWF-File