Addeventlistener

i am looking for a script that ill count ho many times a sound plays. I have the sound play hen they click on the button, so there is actual order that the user ill click on the buttons. hen the sound play 24 times i need it to play a different sound on the 25 time and for the movie to go to frame 2.