I’m building a really simple jukebox clip that dynamically loads mp3 files from the server. The code I’m using is this:
_global.mySound = new Sound();
mySound.resumePos = 0;
mySound.onLoad = function(success) {
if(success) {
this.start(0, 999);
}
}
// Executes when stop button is pressed;
Sound.protoype.stopSound() {
this.resumePos = this.position;
this.stop();
}
// Executes when play (resume) button is pressed;
Sound.prototype.resumeSound() {
this.start(this.resumePos, 999);
}
mySound.loadSound("mp3/lounge.mp3", true);
There’s some more code that toggles the state of the buttons, which I left out for the sake of legibility. Everything works fine, but once the stop button is pressed, the play button fails to resume (play) the sound again. What is it I’m doing wrong?