# Music player progress bar

**URL:** <https://forum.kirupa.com/t/music-player-progress-bar/64447>\
**Category:** flash\
**Created:** [September 16, 2004, 11:31am UTC](https://forum.kirupa.com/t/music-player-progress-bar/64447 "2004-09-16T11:31:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Skinny\_T](https://avatars.discourse-cdn.com/v4/letter/s/eada6e/32.png) [@Skinny\_T](https://forum.kirupa.com/u/Skinny_T)\
**Post date:** [September 16, 2004, 11:31am UTC](https://forum.kirupa.com/t/music-player-progress-bar/64447/1 "2004-09-16T11:31:51Z")

</div>

I had a search around here and on flashkit and couldnt find anything so I was wondering If anyone knows of a tutorial or an open source file or something that has what I need. Thanks in advance!

---

<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:** [September 16, 2004, 1:08pm UTC](https://forum.kirupa.com/t/music-player-progress-bar/64447/2 "2004-09-16T13:08:01Z")

</div>

[http://www.flashkit.com/movies/Scripting/Control/scrub\_co-Mark\_Gas-7597/index.php](http://www.flashkit.com/movies/Scripting/Control/scrub_co-Mark_Gas-7597/index.php)

Maybe this might help… dunno…

---

<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:** [September 16, 2004, 4:03pm UTC](https://forum.kirupa.com/t/music-player-progress-bar/64447/3 "2004-09-16T16:03:34Z")

</div>

here’s some snippets that may help you:

```auto
//Methods:
mySound.attachSound();
mySound.getBytesLoaded();
mySound.getBytesTotal();
mySound.getPan()
mySound.getTransform()
mySound.getVolume()
mySound.loadSound();
mySound.setPan();
mySound.setTransform();
mySound.setVolume();
mySound.start();
mySound.stop();

//Properties:
mySound.duration;
mySound.position;

//Events:
mySound.onLoad() = function {};
mySound.onSoundComplete() = function {};

```

ok, these are all the things you can use with sound in flash.

if you were thinking about making a progress bar, then one way to do it would be to have a movieclip that scales depending on the position of play in the sound.  
maybe something like this:  
(btw: i’d put this onto a movieclip or something so you can use onEnterFrame)

```auto
OnClipEvent(enterFrame) {
    //calculate the position of the sound in percent so that we can use _xscale easily
    percentOfPlay = (mySound.position/mySound.duration)*100;
    progressbar._xscale = percentOfPlay;
}

```

hope this helps
