# SoundChannel.play(pauseTime) (pausing a movie with sound)

**URL:** <https://forum.kirupa.com/t/soundchannel-play-pausetime-pausing-a-movie-with-sound/267481>\
**Category:** flash\
**Created:** [August 1, 2008, 5:17pm UTC](https://forum.kirupa.com/t/soundchannel-play-pausetime-pausing-a-movie-with-sound/267481 "2008-08-01T17:17:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![FfanaticR](https://avatars.discourse-cdn.com/v4/letter/f/13edae/32.png) [@FfanaticR](https://forum.kirupa.com/u/FfanaticR)\
**Post date:** [August 1, 2008, 5:17pm UTC](https://forum.kirupa.com/t/soundchannel-play-pausetime-pausing-a-movie-with-sound/267481/1 "2008-08-01T17:17:55Z")

</div>

Alright. So I’ve viewed this forum many times for help, but I now need to ask a question of my own.

So I’m making a video that illustrates an mp3 narration. I decided to make the a_nimations on my main timeline,_ (mostly textbook pages and highlighting) and I have loaded the \*mp3 into a soundChannel \*and this video is only supposed to have basic pause/play functionality that \*pauses the sound and the time line.

\*I’ll show you my code then explain the problem.

```auto
var soundRequest:URLRequest = new URLRequest("wk1_day1.mp3");
var soundLoader:Loader = new Loader;
var sound:Sound = new Sound;
**var soundControl:SoundChannel = new SoundChannel;**
 **var pauseTime:Number = 0;**
sound.load(soundRequest);
pause_mc.alpha = 0;
pause_mc.visible = false;
play_mc.visible = true;
play_mc.buttonMode = true;

sound.addEventListener(Event.COMPLETE, loaded);
stop();

**function loaded(e:Event):void**
{
    play_mc.addEventListener(MouseEvent.CLICK, playSound);
}

**function playSound(e:Event):void**
{
**soundControl = sound.play(pauseTime);**
    play();
    play_mc.visible = false;
    play_mc.removeEventListener(MouseEvent.CLICK, playSound);
    pause_mc.visible = true;
    pause_mc.addEventListener(MouseEvent.CLICK, stopSound);
}

function stopSound(e:Event):void
{
   ** pauseTime = soundControl.position;
    soundControl.stop();**
    stop();
    pause_mc.visible = false;
    pause_mc.removeEventListener(MouseEvent.CLICK, stopSound);
    play_mc.visible = true;
    play_mc.addEventListener(MouseEvent.CLICK, playSound);          
}

```

The time line pauses and the sound stops however the problem is with my soundControl = sound.play(pauseTime);

When I pause and play it’s as if I just muted the mp3 and then unmuted it. The mp3 stops, but \*resumes not at the time I paused \*but at the time it would be at if I hadn’t paused it at all.

I put in trace() statements on my pause time in both my play and stop methods, and they definitely are the same, but why is it playing at a different time then pausing?

I’ve made an mp3 player so I just ripped this code off of that, but my mp3 player was only 1 frame long… so maybe thats part of the problem??

**Any corrections to my code, or even, suggesting a better way of doing this movie would be great!**
