all'interno del mc "play" fai un ulteriore frame con il clip dello stop (ovviamente con action stop()
poi al mc play dai un nome istanza (ad esempio play_mc)
nella libreria alla tua traccia dai un nome concatenamento (ad esempio "musica")
nella timeline poi vai a scrivere il codice seguente:
codice://setto la variabile a false riproduzione = false; //FUNZIONE SUONO function playSound(soundID) { soundobject = new Sound(); soundobject.attachSound(soundID); soundobject.start(posSound, 1); soundobject.onSoundComplete = function() { soundobject.start(0, 1000); }; } play_mc.onPress = function() { posSound = Math.round((soundobject.position)/1000); if (!riproduzione) { playSound("musica"); riproduzione = true; this.gotoAndStop("frame_stop"); } else { soundobject.stop(); riproduzione = false; this.gotoAndStop("frame_play"); } };


Rispondi quotando