Im trying to make a simple interactive flash animation so when you roll over a invisible button a sound plays from the library, then when you roll out the sound stops.
So far i have this
import flash.events.Event;
import flash.media.SoundChannel;
stop();
button1.addEventListener(MouseEvent.ROLL_OVER,playSound);
function playSound(event:Event) {
var mySound:elmosample = new elmosample();
var myCahnnel:SoundChannel = mySound.play();
}`
Is there a way to stop the sound playing with ROLL_OUT or stop the current sound when a new one starts?
maybe write a function on roll out ?
something like
button1.addEventListener(MouseEvent.ROLL_OUT,stopSound);
and with only playing one song at one time
maybe put your sound variable name into one array
and only use one channel ?
but I am not sure how you play a new sound
so I can’t give you a clear answer
hope this helps