# PAUSE dynamically loaded mp3 (not stop)

**URL:** https://forum.kirupa.com/t/pause-dynamically-loaded-mp3-not-stop/170206
**Category:** flash
**Created:** [November 23, 2005, 6:05pm UTC](https://forum.kirupa.com/t/pause-dynamically-loaded-mp3-not-stop/170206 "2005-11-23T18:05:49Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![cmart](https://avatars.discourse-cdn.com/v4/letter/c/977dab/32.png) [@cmart](https://forum.kirupa.com/u/cmart)
#### Post date: [November 23, 2005, 6:05pm UTC](https://forum.kirupa.com/t/pause-dynamically-loaded-mp3-not-stop/170206/1 "2005-11-23T18:05:49Z")

</div>

Hi all, I did a search and looked at tons of threads including Voetsjoba mp3 player.

This is way more complicated than what i need / want. i already have an mp3 player I’ve built that uses dynamic text (song title and track info) and variables to load an mp3 dynamically through .php & FlashVars. I only need 1 mp3 playing at one time and so this method works great for me. This way I can update it without going into Flash at all (but XML is overkill so no need for that either).

Thing is, **I would like to have a play and stop button that actually stops and starts the track where it last was stopped / paused, rather than resuming from the beginning.**

I also have built in a volume slider.

Here is the Actionscript I’ve been using:

ON VOLUME SLIDER MC [mySlider]:

```auto

onClipEvent (load) {
	mySound = new Sound();
	mySound.loadSound(mp3Title,true);
}
onClipEvent (enterFrame) {
	mySound.setVolume(_root.volume);
}

```

ON PLAY BUTTON:

```auto

on (release) {
		_root.mySlider.mySound.start();
}

```

ON STOP (PAUSE) BUTTON:

```auto

on (release) {
	_root.mySlider.mySound.stop();
}

```

ON DRAGGER INSIDE VOLUME SLIDER MC:

```auto

this.ratio = 0;
dragger.onPress = function() {
	this.startDrag(true, 0, 0, line._width, 0);
	this.onEnterFrame = function() {
		ratio = Math.round(this._x*100/line._width);
			_root.volume = ratio;
	};
};
dragger.onRelease = dragger.onreleaseOutside=stopDrag;

```

works ok, but like i said…stop does not “pause” the mp3 but rather stops it irrecoverably.

play starts from the beginning which I would like to avoid.

thanks in advance.
