Copy link to clipboard
Copied
Hello guys,
I have a little problem when I have to make pause and resume button for the timeline.
The file contains animations with some Movie clip (lips movement) and Sound (the character voices).
Is there any script who can make the frame stopped, movie clip stopped, and the Sound stop too?
Here is the workspace which contains the movie clips and sound.
Thanks for the help.
Try this and see if it helps. Adobe ActionScript 3.0 * Pausing and resuming a sound
Copy link to clipboard
Copied
If you select a frame with a sound and check the properties panel, you can change the sync of the sound from Event to Stream. Now when scrubbing through the timeline you will hear different parts of the sound. If you don't want to hear that, you can click at the top where it says Control and select Mute Sounds.
Copy link to clipboard
Copied
Thanks for the help!
The stream sync is new for me.
I'll try
Copy link to clipboard
Copied
The reason he said to change sounds to stream is because stream sounds are locked in synch with the timeline. So if you pause the timeline, it automatically pauses the sound as well.
If you want symbol animations to stay in synch with their parent timeline, make them graphics instead of movieclips.
Copy link to clipboard
Copied
You make RandomlyFish explanation crystal clear.
Thanks for the help, friend.
Copy link to clipboard
Copied
Try this and see if it helps. Adobe ActionScript 3.0 * Pausing and resuming a sound
Copy link to clipboard
Copied
I will check it out. Thanks friend!
Copy link to clipboard
Copied
I've tried and I little bit confused.
Because my animation consists of several sources of sound (please check my timeline)
If I use this code...
var snd:Sound = new Sound(new URLRequest("bigSound.mp3")); var channel:SoundChannel = snd.play();
...do I need to change URLRequest, every time the sound changed? Coz I have a lot of conversation and it will be taking tons of time.
It is the only way?
Or I have to change something first, after set the sound to stream.
Thanks
Copy link to clipboard
Copied
Your image made it seem like you were playing timeline sounds. If you're also playing sound with code, see if this short article helps:
Copy link to clipboard
Copied
Thanks mate, but I've already tried it. I'm stuck because of I have a lot of sound sources if use that method. Just like my recent comment.
Copy link to clipboard
Copied
Sorry, I hadn't noticed someone had given that link already.
You can keep an array of all of the sounds that are currently playing, and their positions when you stop them, to then start them again at the right positions.
If you had four sounds, a.mp3, b.mp3, c.mp3, d.mp3, and a stopbtn and a startbtn, this code would play all for sounds, let you stop them, and continue them where they left off. It all happens pretty quickly:
import flash.media.Sound;
import flash.media.SoundChannel;
import flash.net.URLRequest;
import flash.events.MouseEvent;
var files:Array = ["a.mp3","b.mp3","c.mp3","d.mp3"];
var sounds:Array = [];
var soundchannels:Array = [];
var soundpositions:Array = [];
startsounds();
stopbtn.addEventListener(MouseEvent.CLICK,stopsounds);
startbtn.addEventListener(MouseEvent.CLICK,playsounds);
stop();
function startsounds(){
var i:int;
var snd:Sound;
var chn:SoundChannel;
soundchannels = [];
for(i = 0;i< files.length;i++){
snd = new Sound(new URLRequest(files));
chn = snd.play();
sounds.push(snd);
soundchannels.push(chn);
}
}
function stopsounds(e:MouseEvent){
var i:int;
var chn:SoundChannel;
soundpositions = [];
for(i = 0;i< sounds.length;i++){
chn = soundchannels;
soundpositions.push(chn.position);
chn.stop();
}
}
function playsounds(e:MouseEvent){
var i:int;
var chn:SoundChannel;
soundchannels = [];
for(i = 0;i< sounds.length;i++){
chn = sounds.play(soundpositions);
soundchannels.push(chn);
}
}
Copy link to clipboard
Copied
Wow, thanks for the help. I will try this first.
Thanks in advance.