Hi, everyone.
I'm new to this flash thing (adobe flash cs5 and as3) and i'm trying to make a scratch looper.
I've made some letters (turned them into buttons) and can't manage them to do what they are supposed to.

I need them (each letter) to play a soundloop whenever i click on them. If i click twice i want them to stop playing. Forthermore, if i click on a different letter than the one that is playing, i want to stop the previous sound and then when i click again to play its own loop.

Until now i only managed to get to play the loop whenever i click on a letter since i imported the sound on the ''down'' area inside the button workarea. What i get is the sound i want looping but whenever i click on the same letter it plays the sound over the one that already plays.

i also tried this code as a plan b (from code snippets):

button_s.addEventListener(MouseEvent.CLICK, fl_ClickToPlayStopSound_6);

var fl_SC_6:SoundChannel;


var fl_ToPlay_6:Boolean = true;

function fl_ClickToPlayStopSound_6(evt:MouseEvent):void
{
if(fl_ToPlay_6)
{
var s:Sound = new Sound(new URLRequest("TheRloop2.wav"));
fl_SC_6 = s.play();
}
else
{
fl_SC_6.stop();
}
fl_ToPlay_6 = !fl_ToPlay_6;
}

it gives me a lot of errors

Thanks in advance everyone...