# Play/pause toggle help pls

**URL:** https://forum.kirupa.com/t/play-pause-toggle-help-pls/298550
**Category:** Uncategorized
**Created:** [October 21, 2009, 12:20am UTC](https://forum.kirupa.com/t/play-pause-toggle-help-pls/298550 "2009-10-21T00:20:24Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![oluc](https://avatars.discourse-cdn.com/v4/letter/o/cc9497/32.png) [@oluc](https://forum.kirupa.com/u/oluc)
#### Post date: [October 21, 2009, 12:20am UTC](https://forum.kirupa.com/t/play-pause-toggle-help-pls/298550/1 "2009-10-21T00:20:24Z")

</div>

Hello! I need a little help getting a toggle button to work properly.

I have the following code for a custom btn to play/pause toggle a video I have loaded. The only thing is that its not working… I can get it to play and pause but I cant get it to resume playing. It just keeps being paused even after I press the playBtn.

[AS]  
//btns added to stage in code not shown  
playBtn.addEventListener(MouseEvent.CLICK, playPauseVideo)  
pauseBtn.addEventListener(MouseEvent.CLICK, playPauseVideo)  
}  
public function playPauseVideo (event:MouseEvent):void {  
if (player.playing) {  
if (player.paused) player.pause();  
else player.pause();  
playBtn.visible = player.paused;  
playBtn.visible = !player.paused;

```
  }else{
      player.play("video.f4v", 60, false);
      pauseBtn.visible = true;
      playBtn.visible = false;
   }

```

}[/AS]

can u pls give me a hand?
