# \[MX\] mp3 sound position / sound length?

**URL:** <https://forum.kirupa.com/t/mx-mp3-sound-position-sound-length/19476>\
**Category:** flash\
**Created:** [April 28, 2003, 3:54pm UTC](https://forum.kirupa.com/t/mx-mp3-sound-position-sound-length/19476 "2003-04-28T15:54:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![byis](https://avatars.discourse-cdn.com/v4/letter/b/5e9695/32.png) [@byis](https://forum.kirupa.com/u/byis)\
**Post date:** [April 28, 2003, 3:54pm UTC](https://forum.kirupa.com/t/mx-mp3-sound-position-sound-length/19476/1 "2003-04-28T15:54:36Z")

</div>

Hi, I am trying to get mp3 sound position and sound length to work. Heres the code below and I ahve attached the FLA.

```auto

// Create a new Sound object.
var music = new Sound();
// Create a text field to show sound length.
this.createTextField("dur", 1, 100, 100, 200, 30);
dur.border = true;
dur.setNewTextFormat(new TextFormat("Verdena", 20));
// Show sound length.
dur.text = s.duration;
// Create a text field to show sound position.
this.createTextField("pos", 2, 100, 150, 200, 30);
pos.border = true;
pos.setNewTextFormat(dur.getNewTextFormat());
// handy, eh?
// Every frame, display how much of the sound has played.
this.onEnterFrame = function() {
    pos.text = s.position;
};

```

I have attached my FLA file. You will need to through a MP3 in the same dir as swf file names test.mp3…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 28, 2003, 5:01pm UTC](https://forum.kirupa.com/t/mx-mp3-sound-position-sound-length/19476/2 "2003-04-28T17:01:23Z")

</div>

[http://www.flashkit.com/tutorials/Audio/Flash\_MX-Kenny\_Be-824/](http://www.flashkit.com/tutorials/Audio/Flash_MX-Kenny_Be-824/)
