# Audio player woe's

**URL:** <https://forum.kirupa.com/t/audio-player-woes/191603>\
**Category:** Uncategorized\
**Created:** [June 21, 2006, 6:09pm UTC](https://forum.kirupa.com/t/audio-player-woes/191603 "2006-06-21T18:09:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![phish007](https://avatars.discourse-cdn.com/v4/letter/p/aeb1de/32.png) [@phish007](https://forum.kirupa.com/u/phish007)\
**Post date:** [June 21, 2006, 6:09pm UTC](https://forum.kirupa.com/t/audio-player-woes/191603/1 "2006-06-21T18:09:16Z")

</div>

hey guys i have this audio player and it worked great until I put my whole site within a movie clip so I could getthat fullscreen centered flash look. for some reason the forward and back buttons work, but the display txt became disabled aswell as the stop/play buttons. Im not too good with AS does anysee anything wrong this code: check this out for a visual: [http://www.matchmakerrock.com/test](http://www.matchmakerrock.com/test)

stop();  
playlist = new XML();  
playlist.ignoreWhite = true;  
playlist.onLoad = function(success) {  
if (success) {  
\_global.songname = [];  
\_global.songfile = [];  
for (var i = 0; i\<playlist.firstChild.childNodes.length; i++) {  
\_global.songname\* = playlist.firstChild.childNodes\*.attributes.name;  
\_global.songfile\* = playlist.firstChild.childNodes\*.attributes.file;  
// trace(songname\*+" “+songfile\*+” “+songband\*);  
}  
}  
\_root.createEmptyMovieClip(“sound\_mc”, 1);  
\_global.song\_nr = random(songfile.length);  
\_root.sound\_mc.songStarter(songfile[song\_nr], songname[song\_nr]);  
};  
function timer(sound\_obj) {  
time = sound\_obj.position/1000;  
min = Math.floor(time/60);  
min = (min\<10) ? “0”+min : min;  
sec = Math.floor(time%60);  
sec = (sec\<10) ? “0”+sec : sec;  
timeDisplay\_txt.text = min+”:"+sec;  
}  
MovieClip.prototype.songStarter = function(file, name) {  
if (this.sound\_obj) {  
this.sound\_obj.stop();  
delete this.sound\_obj;  
}  
this.sound\_obj = new Sound(this);  
this.sound\_obj.loadSound(file, true);  
this.onEnterFrame = function() {  
if (this.sound\_obj.position\>0) {  
delete this.onEnterFrame;  
this.\_parent.display\_txt.text = name;  
timeInterval = setInterval(timer, 1000, this.sound\_obj);  
} else {  
this.\_parent.display\_txt.text = “loading…”;  
}  
};  
this.sound\_obj.onSoundComplete = function() {  
clearInterval(timeInterval);  
this.\_parent.timeDisplay\_txt.text = “00:00”;  
(song\_nr == songfile.length-1) ? \_global.song\_nr=0 : \_global.song\_nr++;  
\_root.sound\_mc.songStarter(songfile[song\_nr], songname[song\_nr]);  
};  
this.\_parent.volume1.dragger.onPress = function() {  
startDrag(this, true, 0, this.\_y, this.\_parent.volBG.\_width, this.\_y);  
this.onEnterFrame = function() {  
var p = (this.\_x/this.\_parent.volBG.\_width)\*100;  
this.\_parent.\_parent.sound\_mc.sound\_obj.setVolume§;  
};  
};  
this.\_parent.volume1.dragger.onRelease = function() {  
delete this.onEnterFrame;  
stopDrag();  
};  
this.\_parent.volume1.dragger.onReleaseOutside = function() {  
stopDrag();  
};  
};  
btn\_play.onRelease = function() {  
clearInterval(timeInterval);  
this.\_parent.timeDisplay\_txt.text = “00:00”;  
this.\_parent.sound\_mc.songStarter(songfile[song\_nr], songname[song\_nr]);  
};  
btn\_stop.onRelease = function() {  
clearInterval(timeInterval);  
this.\_parent.timeDisplay\_txt.text = “00:00”;  
this.\_parent.sound\_mc.sound\_obj.stop();  
};  
btn\_fw.onRelease = function() {  
clearInterval(timeInterval);  
this.\_parent.timeDisplay\_txt.text = “00:00”;  
(song\_nr == songfile.length-1) ? \_global.song\_nr=0 : \_global.song\_nr++;  
\_root.sound\_mc.songStarter(songfile[song\_nr], songname[song\_nr]);  
};  
btn\_rev.onRelease = function() {  
clearInterval(timeInterval);  
this.\_parent.timeDisplay\_txt.text = “00:00”;  
(song\_nr == 0) ? \_global.song\_nr=songfile.length-1 : \_global.song\_nr–;  
\_root.sound\_mc.songStarter(songfile[song\_nr], songname[song\_nr]);  
};  
playlist.load(“playlist.xml”);

Thanks all any help is greatly appreciated
