How do I change a button, onclick, in ActionScript? Show/hide?

Zack Burt picture Zack Burt · Aug 17, 2009 · Viewed 9.2k times · Source

Using ActionScript 2.0, how do I show or hide a button onclick? I am making a simple mp3 player, and would like my pause button to change to a play button when clicked, and vice versa.

Answer

Unreality picture Unreality · Aug 17, 2009
play_btn.onRelease = function () {
    // do something here.. like play mp3
    play_btn._visible = false;
    pause_btn._visible = true;
}

pause_btn.onRelease = function () {
    // do something here.. like pause mp3
    play_btn._visible = true;
    pause_btn._visible = false;
}

please be remember to give the instance name of play_btn and pause_btn to the play and pause buttons