# Play/pause button help

**URL:** <https://forum.kirupa.com/t/play-pause-button-help/236678>\
**Category:** Uncategorized\
**Created:** [August 22, 2007, 7:56pm UTC](https://forum.kirupa.com/t/play-pause-button-help/236678 "2007-08-22T19:56:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dgg](https://avatars.discourse-cdn.com/v4/letter/d/ccd318/32.png) [@dgg](https://forum.kirupa.com/u/dgg)\
**Post date:** [August 22, 2007, 7:56pm UTC](https://forum.kirupa.com/t/play-pause-button-help/236678/1 "2007-08-22T19:56:25Z")

</div>

I have a slideshow that plays when a button is clicked, and pauses when clicked agian. Now I want the button to change the graphic when clicked from a play picture to a pause picture and back again. I have found stuff for as2 but not really for as3 (at least nothing I could understand), so can someone give me some pointers? My as3 code for the current play button looks like this:

play\_btn.addEventListener(MouseEvent.CLICK, onPlay);  
function onPlay(evt:MouseEvent):void {  
if (playOnClick){  
timer.start();  
playOnClick = false;  
} else{  
timer.reset();  
playOnClick = true;  
}
