Progress Bar Problem

Hi There…

Wonder if someone could help me…
I’m fairly new to Flash…and Actionscript even more so!
I busy creating my own custom media player according to turtorial I’ve found…

http://blog.six4rty.ch/tutorials/flash-create-a-full-streaming-flash-mp3-player-using-xml-pt-1/

I’ve done pretty much everything explained, however all I actually need is the Buttons/Dynamic Text (Song Title) and of course a ‘progress bar’…

I’ve done everything as explained…However my progress bar:

  1. Doesn’t reset when I click to next or previous track.
  2. Seems to run off the actual track…continously…as if it doesnt go insinc with the
    actual track playing?

My obvious problem is not knowing Actionscript well enough I know…but I gotta get this thing to work in order for my html based website to be complete!

Below is the code I have included…

[COLOR=blue]stop();[/COLOR]
[COLOR=blue]playlist= new XML();[/COLOR]
[COLOR=blue]playlist.ignoreWhite=true;[/COLOR]
[COLOR=blue]playlist.onLoad = function (success) {[/COLOR]
[COLOR=blue]if(success) {[/COLOR]
[COLOR=blue]_global.songname = [];[/COLOR]
[COLOR=blue]_global.songfile = [];[/COLOR]
[COLOR=blue]for (var i=0; i<playlist .firstChild.childNodes.length; i++) {[/COLOR]
[COLOR=blue]_global.songname* = playlist.firstChild.childNodes*.attributes.name;[/COLOR]
[COLOR=blue]_global.songfile* = playlist.firstChild.childNodes*.attributes.file;[/COLOR]
[COLOR=blue]trace(songname*+" "+songfile*); }[/COLOR]
[COLOR=blue]_root.createEmptyMovieClip(“sound_mc”,1);[/COLOR]
[COLOR=blue]_root.sound_mc.sound_obj = new Sound();[/COLOR]
[COLOR=blue]_global.song_nr = random(songfile.length); _root.sound_mc.songStarter(songfile[song_nr],songname[song_nr]); [/COLOR]
[COLOR=blue]} else {display_txt.text=“Error Loading XML”}[/COLOR]
[COLOR=blue]}[/COLOR]
[COLOR=blue]MovieClip.prototype.songStarter = function (file, name) {[/COLOR]
[COLOR=blue]this.sound_obj.loadSound(file,true)[/COLOR]
[COLOR=blue]this.onEnterFrame = function () {[/COLOR]
[COLOR=blue]if(this.sound_obj.position>0) {[/COLOR]
[COLOR=blue]delete this.onEnterFrame;[/COLOR]
[COLOR=blue]this._parent.display_txt.text=name; [/COLOR]
[COLOR=blue]} else {[/COLOR]
[COLOR=blue]this._parent.display_txt.text=“loading…” [/COLOR]
[COLOR=blue]}[/COLOR]
[COLOR=blue]}[/COLOR]
[COLOR=blue]this.sound_obj.onSoundComplete = function () {[/COLOR]
COLOR=blue? _global.song_nr=0 : _global.song_nr++;[/COLOR]
[COLOR=blue]_root.sound_mc.songStarter(songfile[song_nr],songname[song_nr]);[/COLOR]
[COLOR=blue]}[/COLOR]
[COLOR=blue]}[/COLOR]
[COLOR=blue]function soundStatus(){[/COLOR]
[COLOR=blue]var amountLoaded = _root.sound_mc.sound_obj.getBytesLoaded() / _root.sound_mc.sound_obj.getBytesTotal();[/COLOR]
[COLOR=blue]_root.loader.loadBar._width = amountLoaded * 334;[/COLOR]
[COLOR=blue]duration = _root.sound_mc.sound_obj.duration;[/COLOR]
[COLOR=blue]position = _root.sound_mc.sound_obj.position;[/COLOR]
[COLOR=blue]_root.playHead._x = position / duration * 346 + 5;[/COLOR]
[COLOR=blue]}[/COLOR]

[COLOR=blue]btn_play.onRelease = function () {[/COLOR]
[COLOR=blue]this._parent.sound_mc.songStarter(songfile[song_nr],songname[song_nr]);[/COLOR]
[COLOR=blue]}[/COLOR]
[COLOR=blue]btn_stop.onRelease = function() {[/COLOR]
[COLOR=blue]this._parent.sound_mc.sound_obj.stop(); [/COLOR]
[COLOR=blue]}[/COLOR]
[COLOR=blue]btn_next.onRelease = function () {[/COLOR]
COLOR=blue? _global.song_nr=0 : _global.song_nr++;[/COLOR]
[COLOR=blue]_root.sound_mc.songStarter(songfile[song_nr],songname[song_nr]);[/COLOR]
[COLOR=blue]}[/COLOR]
[COLOR=blue]btn_prev.onRelease = function () {[/COLOR]
COLOR=blue? _global.song_nr=songfile.length-1 : _global.song_nr–;[/COLOR]
[COLOR=blue]_root.sound_mc.songStarter(songfile[song_nr],songname[song_nr]);[/COLOR]
[COLOR=blue]}[/COLOR]
[COLOR=blue]playlist.load(“playlist.xml”);[/COLOR]
[COLOR=blue]setInterval(soundStatus,100);[/COLOR]

[COLOR=black]I would really appreciate some help…[/COLOR]
[COLOR=black][/COLOR]
[COLOR=black]Thanks inadvance![/COLOR]