Hey, I got this mp3 component along time ago, and the creator doesn’t have any help on it.
I have now edited the buttons etc, and put it on my stage, but it only works when streaming is off. But I need it to be on…
Could anyone see if they find the error?
Heres the AS for the component:
#initclip 1
function AudioClass() {
this.MySound = new Sound();
this.loadAudio();
}
AudioClass.prototype = new MovieClip();
AudioClass.prototype.loadAudio = function() {
this.MySound.loadSound(this.AudioArray[0], this.FlagStream);
this.MySound.stop();
this.Mp3title = this.AudioTitle[0];
this.MySound.stop();
};
AudioClass.prototype.PlayAudio = function() {
if (this.FlagPausa == true) {
this.MySound.start(this.PosPausa, 0);
this.FlagPausa = false;
this.PosPausa = undefined;
} else {
this.FlagPausa = false;
this.MySound.start();
}
};
AudioClass.prototype.PausarAudio = function() {
this.PosPausa = this.MySound.position/1000;
this.MySound.stop();
this.FlagPausa = true;
};
AudioClass.prototype.StopAudio = function() {
this.MySound.stop();
};
AudioClass.prototype.Skip1 = function() {
this.shifted = this.AudioArray.shift();
this.shiftTitle = this.AudioTitle.shift();
this.AudioArray.push(this.shifted);
this.AudioTitle.push(this.shiftTitle);
this.loadAudio();
this.MySound.Stop();
};
AudioClass.prototype.Skip2 = function() {
this.Poped = this.AudioArray.pop();
this.PopedTitle = this.AudioTitle.pop();
this.AudioArray.splice(0, 0, this.Poped);
this.AudioTitle.splice(0, 0, this.PopedTitle);
this.loadAudio();
this.MySound.stop();
};
Object.registerClass("SimpleMp3Player", AudioClass);
#endinitclip
and
Ff.onPress = function() {
_parent.Skip1();
};
Rw.onPress = function() {
_parent.Skip2();
};
PlayBtn.onPress = function() {
_parent.PlayAudio();
};
StopBtn.onPress = function() {
_parent.StopAudio();
};
PauseBtn.onPress = function() {
_parent.PausarAudio();
};
Really need help…
Thanks,fatnslow