# Play and pause button all in one

**URL:** <https://forum.kirupa.com/t/play-and-pause-button-all-in-one/285653>\
**Category:** flash\
**Created:** [April 3, 2009, 3:01pm UTC](https://forum.kirupa.com/t/play-and-pause-button-all-in-one/285653 "2009-04-03T15:01:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![atlnycdude24](https://avatars.discourse-cdn.com/v4/letter/a/e0b2c6/32.png) [@atlnycdude24](https://forum.kirupa.com/u/atlnycdude24)\
**Post date:** [April 3, 2009, 3:01pm UTC](https://forum.kirupa.com/t/play-and-pause-button-all-in-one/285653/1 "2009-04-03T15:01:13Z")

</div>

Okay I’m making a mp3 player using flash and i would like to have the play and pause function all in one button rather having separating into two buttons. Here is the code what I have so far.

```auto

playpause_button.addEventListener(MouseEvent.CLICK, playpauseButtonClick);

function playpauseButtonClick( event:MouseEvent):void {
    theChannel = theSound.play(pausepoint);
    pausepoint = theChannel.position;
    theChannel.stop();
}

```

whenever i hit the pause and play button it won’t pause. The stop button has a

```auto

pausepoint = 0;

```
