Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

[AS3] How to pause Movie Clip, Frame, and Sound at the same time?

Explorer ,
Aug 26, 2017 Aug 26, 2017

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.

2017-08-26.png

2.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Aug 26, 2017 Aug 26, 2017
Translate
Contributor ,
Aug 26, 2017 Aug 26, 2017

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 26, 2017 Aug 26, 2017

Thanks for the help!
The stream sync is new for me.
I'll try

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 26, 2017 Aug 26, 2017

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 26, 2017 Aug 26, 2017

You make RandomlyFish explanation crystal clear.
Thanks for the help, friend.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 26, 2017 Aug 26, 2017
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 26, 2017 Aug 26, 2017

I will check it out. Thanks friend!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 03, 2017 Sep 03, 2017

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 03, 2017 Sep 03, 2017

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:

Adobe ActionScript 3.0 * Pausing and resuming a sound

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 03, 2017 Sep 03, 2017

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 03, 2017 Sep 03, 2017

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);

  }

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 03, 2017 Sep 03, 2017
LATEST

Wow, thanks for the help. I will try this first.
Thanks in advance.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines