i've got some audio of some narration for a prject, and need to be able to allow the user to pause and resume as they need. any tips? i've seen a few examples but need them explaining to me
I'm kinda guessing but i think you could just put the sound into a movie clip of it's own- make sure the sound is set to stream. Then create two buttons that control this MC independent of the main timeline. If that's not clear then there are loads of tutorials on this site dedicated to sound.
//define sound object
tune = new Sound();
tune.attachSound("music");
tune.start();
//create pause function (convert position into seconds)
function pause() {
pausePoint = tune.position/1000;
trace(pausePoint);
tune.stop();
}
//restart track and skip to point where we paused it
function resume() {
tune.start(pausePoint);
}
//controls
pause_btn.onRelease = function() {
pause();
};
//
resume_btn.onRelease = function() {
resume();
};