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

Sound Help!

Explorer ,
Nov 26, 2017 Nov 26, 2017

Hello everyone. I'm having trouble with some sound on my Timeline. I'm sure there is a code to get it the way I want but I don'y know it.

Capture.PNG

So basically here is what I want.

On the Layer "Beat" I have music set on Stream because I want it to play forever.

When I get to Frame 5 "S1 Multi" The sounds and animation for that MC plays fine. Also Beat Continues to play like I want.

On Frame 5 I also have a button that is stand alone. On its own layer. If you click it, it navigates you to the next MC on Frame 6 "S2 Fly"

The problem is. The music gets carried over from Frame 5 "S1 Multi" and jumbles in with Frame 6 "S2 Fly" because it doesn't know it needs to stop.

But if I insert a :

import flash.media.SoundMixer;

SoundMixer.stopAll();

It will also stop "Beat" which I want to play forever.

So I can't find a way to stop music playing within a Move Clip. That way it doesn't carry on into another Movie Clip.

571
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

LEGEND , Nov 27, 2017 Nov 27, 2017

Here's a different approach:

Make the sounds inside the movieclips be Stream.

Make Beat be Event, and looped.

In the script that takes you from frame 5 to 6, include something that stop "S1 Multi" and starts playing "S3 Fly" after you have gone to frame 6.

Something like:

btn.addEventListener(MouseEvent.CLICK, gosix);

function gosix(e:MouseEvent){

   btn.removeEventListener(MouseEvent.CLICK, gosix);

   s1multi.stop();

   gotoAndStop(6);

  s3fly.play();

}

The s1multi and s3fly would be the names you have giv

...
Translate
LEGEND ,
Nov 26, 2017 Nov 26, 2017

Timmonsxp  wrote

On the Layer "Beat" I have music set on Stream because I want it to play forever.

That's the opposite of what Stream does. Stream locks sound playback to the playhead position.

Read the documentation: How to use sound in Adobe Animate CC

- Event plays a sound every time the playhead hits where the sound keyframe is.

- Start plays a sound like Event does, but not if the sound is already playing.

- Stop stops the specified sound.

- Stream syncs sound with the playhead.

Sounds like maybe you need a Stop frame.

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 ,
Nov 26, 2017 Nov 26, 2017

The Movie Clips are all loops until you navigate to the next Via Button. So stopping it would make the sound go away where ever you place it. So if the user isnt ready to navigate. The sound may or may not stop when they are ready to progress.

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 ,
Nov 26, 2017 Nov 26, 2017

I need some kind of sound mixer stop all but only for specific movie clips if that were possible. Not sure. haha that's why i'm asking.

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 ,
Nov 27, 2017 Nov 27, 2017

Timmonsxp  wrote

The Movie Clips are all loops until you navigate to the next Via Button. So stopping it would make the sound go away where ever you place it.

Yes, exactly. You asked how to stop a specific timeline sound. That's how you do it.

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 ,
Nov 27, 2017 Nov 27, 2017

I tried what you said. That defeats the purpose of a loop though. There is no "End Point" for the movieclip. It needs to keep looping until the user is ready. So where can I use the Sync:Stop in the sound properties if there isn't an "Ending Point"? It also doesnt play the sound longer than one frame. (The frame its on) So if a sound rings out for 30 frames it wont play it.

All I need to know is. Is there a way to stop sounds on a looping movieclip so it doesnt progress onto the next movie clip.

I know you can use a

import flash.media.SoundMixer;

SoundMixer.stopAll();

But that makes it to where all the sounds on the entire Timeline stop. And I need the Layer BEAT to play forever.

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 ,
Nov 27, 2017 Nov 27, 2017

Colin Holgate​ Where you at? Haha. Help me buddy.

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 ,
Nov 27, 2017 Nov 27, 2017

Here's a different approach:

Make the sounds inside the movieclips be Stream.

Make Beat be Event, and looped.

In the script that takes you from frame 5 to 6, include something that stop "S1 Multi" and starts playing "S3 Fly" after you have gone to frame 6.

Something like:

btn.addEventListener(MouseEvent.CLICK, gosix);

function gosix(e:MouseEvent){

   btn.removeEventListener(MouseEvent.CLICK, gosix);

   s1multi.stop();

   gotoAndStop(6);

  s3fly.play();

}

The s1multi and s3fly would be the names you have given the 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 ,
Nov 27, 2017 Nov 27, 2017

I'm using buttons to to take me from 5 to 6.

So basically give the movie clips instance names that way I can stop them specifically with the code you just gave?

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 ,
Nov 27, 2017 Nov 27, 2017

I copied your code. I renamed the btn. to my button name.

When it runs it gives me an error.

TypeError: Error #1009: Cannot access a property or method of a null object reference.

at Velvet_fla::MainTimeline/gosix()

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 ,
Nov 27, 2017 Nov 27, 2017

I had a button navigation already in the script and it was getting confused because there were 2 gotoAndStop(); commands. I deleted the code and just used the code you gave me and it works perfectly. Your the best Colin Holgate​

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 ,
Nov 27, 2017 Nov 27, 2017

Glad you made progress. At some point look into doing all this with code, it isn't too difficult to play a sound in code, and then only stop that one sound. But you can figure that out another day!

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 ,
Nov 27, 2017 Nov 27, 2017

Timmonsxp  wrote

I tried what you said. That defeats the purpose of a loop though. There is no "End Point" for the movieclip. It needs to keep looping until the user is ready. So where can I use the Sync:Stop in the sound properties if there isn't an "Ending Point"?

You put it where the timeline jumps to when the user is ready, obviously.

That being said, any stream sounds will automatically stop playing when their containing clip leaves the stage, so you could also manage them that way.

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 ,
Nov 27, 2017 Nov 27, 2017

/throws hands up in despair

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 ,
Nov 27, 2017 Nov 27, 2017
LATEST

Haha. Thanks both of you!

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