PDA

Volledige versie bekijken : Als sound stopt...


Joshua_abdon_sly
%Europe/Berlin %757 %2008, 19:10
Beste FF'ers,

Ik zou graag een muziekje laten horen als je op de play/stop knop drukt, dit is me al gelukt, maar nu wil ik als het muziekje stopt, de stop knop weergegeven wordt.

De voorlopige code:

var bgsound:Sound = new Sound();
bgsound.loadSound("background.mp3", false);
bgsound.onSoundComplete = function() {
bgsound.stop();
};
playstop_mc.stop();
playstop_mc.onRelease = function() {
if (!go) {
go = true;
bgsound.start(0);
this.nextFrame();
} else {
bgsound.stop();
this.prevFrame();
go = false;
}
};

Iemand een suggestie?

grtz
Josh

Jan
%Europe/Berlin %768 %2008, 19:26
maar nu wil ik als het muziekje stopt, de stop knop weergegeven wordt.

bgsound.onSoundComplete = function()
{
bgsound.stop();
stopKnop._visible=true;
}
Groeten,
Jan

Joshua_abdon_sly
%Europe/Berlin %772 %2008, 19:31
hmmz, nu heb ik dit en werkt het zoals het zou moeten werken, behalve als ik het nog eens wil laten spelen moet ik 2 maal klikken?

var bgsound:Sound = new Sound();
bgsound.loadSound("background.mp3", false);
bgsound.onSoundComplete = function() {
bgsound.stop();
playstop_mc.prevFrame()
};
playstop_mc.stop();
playstop_mc.onRelease = function() {
if (!go) {
go = true;
bgsound.start(0);
this.nextFrame();
} else {
bgsound.stop();
this.prevFrame();
go = false;
}
};

grtz
Josh