# Sound.position problem

**URL:** <https://forum.kirupa.com/t/sound-position-problem/271751>\
**Category:** Uncategorized\
**Created:** [September 27, 2008, 6:26pm UTC](https://forum.kirupa.com/t/sound-position-problem/271751 "2008-09-27T18:26:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![esqu](https://avatars.discourse-cdn.com/v4/letter/e/e47774/32.png) [@esqu](https://forum.kirupa.com/u/esqu)\
**Post date:** [September 27, 2008, 6:26pm UTC](https://forum.kirupa.com/t/sound-position-problem/271751/1 "2008-09-27T18:26:42Z")

</div>

Hi everybody,  
I am trying to make an music player. It plays external mp3 files. It shows the duration of the sound object.  
I click to STOP button and stop the music, then I click to PLAY button i can’t reset the time of that music, it continues from where it stopped before…

Stop:

```auto
on (release) {
 dscSound.stop();
 delete lastPosition;
 flagCaliyor = false;
}

```

Play:

```auto
on (release) {
 if (!lastPosition) {
   dscSound.loadSound(String(inc)+".mp3", true);
   dscSound.onID3 = function():Void {
   songInfo.txtArtist.text = dscSound.id3.artist;
   songInfo.txtTitle.text = dscSound.id3.songname;
  };
  dscSound.setVolume(50);
 } else {
    dscSound.start(lastPosition, 0);
 }
 flagCaliyor = true;
 delete lastPosition;
}

```

to show the actual time:

```auto
 
function songTime():Void {
  minutesTotal = Math.floor(_level0.dscSound.duration/60000);
  secondsTotal = Math.floor(_level0.dscSound.duration/1000-minutesTotal*60);
  seconds = Math.floor((_level0.dscSound.position/1000)%60);
  minutes = Math.floor((_level0.dscSound.position/1000)/60);
  hours = Math.floor((_level0.dscSound.position/1000)/120);
  this._parent.songInfo.txtTotalTime.text = minutesTotal+":"+secondsTotal;
  this._parent.songInfo.txtActualTime.text = minutes+":"+seconds;
  trace(_level0.dscSound.position);
 }

```

What can the problem be? Probably I’m missing sth…  
Thanks for your helps…
