# Clearing Sound Position in AS2.0

**URL:** https://forum.kirupa.com/t/clearing-sound-position-in-as2-0/247883
**Category:** flash
**Created:** [December 31, 2007, 7:48pm UTC](https://forum.kirupa.com/t/clearing-sound-position-in-as2-0/247883 "2007-12-31T19:48:32Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![audioholic](https://avatars.discourse-cdn.com/v4/letter/a/f14d63/32.png) [@audioholic](https://forum.kirupa.com/u/audioholic)
#### Post date: [December 31, 2007, 7:48pm UTC](https://forum.kirupa.com/t/clearing-sound-position-in-as2-0/247883/1 "2007-12-31T19:48:32Z")

</div>

Hi,

I’m building an e-learning package and I’m using Play/Pause buttons for voiceovers for different movie clips. I have separate movie clips for slides and a separate layer for the audio functions. Here’s my script:

```auto
soundTest = new Sound();
soundTest.attachSound("slide 1");
soundTest.start();
clipLength.text = soundTest.duration/1000+" s";
pauseClip.onPress = function() {
	pausePositionS = soundTest.position/1000;
	soundTest.stop();
};
startClip.onPress = function() {
	if (soundTest.position == soundTest.duration) {
		soundTest.start();
	} else {
		soundTest.start(pausePositionS);
	}
};
startClip.onEnterFrame = function() {
	currentPosition.text = soundTest.position/1000;
};

```

When ‘startClip’ is pressed, it triggers the pausePositionS function - the sound plays from where it was paused as programmed in pausePositionS function. The catch is that when I resume playback after pausing, it’s working fine. However, if I ‘repress’ the play button, it duplicates the playback from pausePositionS time again, resulting in 2 copies. The ‘n’ number of times I press play, the ‘n’ number of times it starts playing back again!

Even though people won’t really click on the Play button more than once, some people like ME would just want to experiment and report bugs! I want to avoid this.

Your replies will be appreciated! :thumb:

Cheers…  
Sudarshan
