Copy link to clipboard
Copied
Hello,
I'm trying to create a very unique soundboard to use with theatre sound effects and music. I created one using Actionscript 3.0 that plays very short clips with no stop or pause. I want to add longer clips that I can play, stop or even pause. This button play plays but I am trying how to stop, and pause. Any help would be much appreciated.
i don't know why you're showing a button "timeline" because that's not relevant to what you want. ie, whether you use a button (or buttons) or movieclip (or movieclips) to start, play, stop and pause is incidental.
you can use:
var sound:Sound;
var sc:SoundChannel;
var pos:Number;
function playF(s:Sound):void{
sc = s.play();
sound =s;
}
function stopF():void{
pos = sc.position;
sc.stop();
}
function resumeF():void{
sc = sound.play(pos);
}
p.s. you'll probably want to add idiot-proofing
...Copy link to clipboard
Copied
i don't know why you're showing a button "timeline" because that's not relevant to what you want. ie, whether you use a button (or buttons) or movieclip (or movieclips) to start, play, stop and pause is incidental.
you can use:
var sound:Sound;
var sc:SoundChannel;
var pos:Number;
function playF(s:Sound):void{
sc = s.play();
sound =s;
}
function stopF():void{
pos = sc.position;
sc.stop();
}
function resumeF():void{
sc = sound.play(pos);
}
p.s. you'll probably want to add idiot-proofing to prevent playing of multiple sounds
Copy link to clipboard
Copied
Got it. I'm new to coding. I will take me some time to build this thing.
Copy link to clipboard
Copied
you're welcome.