How to change a button, onclick, in ActionScript? Show hide?

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

+3
source share
2 answers
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;
}

do not forget to specify the instance name play_btn and pause_btn for the play and pause buttons

+4
source

Instead, I create a MovieClip and just simulate a click, etc. using 4 different keyframes

-1
source

Source: https://habr.com/ru/post/1715287/


All Articles