# Problem with Pause button (nearly there I think)

**URL:** https://forum.kirupa.com/t/problem-with-pause-button-nearly-there-i-think/263129
**Category:** flash
**Created:** [June 12, 2008, 7:53pm UTC](https://forum.kirupa.com/t/problem-with-pause-button-nearly-there-i-think/263129 "2008-06-12T19:53:43Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![magicmule](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@magicmule](https://forum.kirupa.com/u/magicmule)
#### Post date: [June 12, 2008, 7:53pm UTC](https://forum.kirupa.com/t/problem-with-pause-button-nearly-there-i-think/263129/1 "2008-06-12T19:53:43Z")

</div>

I think I am nearly there with creating a flash presentation player with audio control but have a slight problem that i’m sure can be tweaked to work with my PLAY/PAUSE button. Hopefully a quick fix for someone who knows more than me.

The set up is a different mc on each frame of the timeline. each mc has an audio narration file dynamically loaded with attachSound. I have a play/pause button (mc) on the first mc frame with the following code:

Frame 1

on (release) {  
myMusicPosition = \_root.sound1.position/1000;  
\_root.sound1.stop(“introduction\_snd”);  
gotoAndStop(2);  
\_root.mc\_clip1.stop();  
}

Frame 2

on (release) {  
\_root.sound1.start(myMusicPosition, 0);  
gotoAndStop(1);  
\_root.mc\_clip1.play();  
}

This works great, when i press the pause button the animation AND sound both pause and again both resume when i press play.  
The problem occurs on frame 2 of the main timeline. I repeat the code and change the mc instance name and sound name accordingly but it only pauses the animation, the audio continues. See below for my play/pause button code for main timeline frame 2.

Frame 1

on (release) {  
myMusicPosition2 = \_root.sound2.position/1000;  
\_root.sound2.stop(“kluge\_story\_snd”);  
gotoAndStop(2);  
\_root.mc\_clip2.stop();  
}

Frame 2

on (release) {  
\_root.sound2.start(myMusicPosition2, 0);  
gotoAndStop(1);  
\_root.mc\_clip2.play();  
}

I think the problem maybe something to do with the “myMusicPosition”, because i’m not exactly how this part works and so thought i would name it “2” in the AS to diffrientiate it from the first button code.

This is kinda hard to explain but i really hope someone can help figure this out.

Thanks.
