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

why does it play both of audios together after some seconds in sheet music animation

Contributor ,
Mar 15, 2024 Mar 15, 2024

Copy link to clipboard

Copied

hello there here i send atached the situation

its working the sheet music animation but

after some seconds it plays both audios

from movie clips....

whats the action script to use here in this situation

to stop the audio when the other plays?

 

Views

1.8K

Translate

Translate

Report

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
replies 100 Replies 100
Contributor ,
Mar 15, 2024 Mar 15, 2024

Copy link to clipboard

Copied

i found this

 

sound.addEventListener(MouseEvent.CLICK, fl_ClickToStopAllSounds);

var sc:SoundChannel;

 

function fl_ClickToStopAllSounds(event:MouseEvent):void

 

{

    SoundMixer.stopAll();

var newSound:NewSound=NewSound();

sc=newSound.play();

}

 

how is it used ? with the action script of the button?

Votes

Translate

Translate

Report

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 ,
Mar 15, 2024 Mar 15, 2024

Copy link to clipboard

Copied

if you're playing your sounds by streaming the sound attached to a timeline, you just need to stop that timeline.  ie, 

 

sound1_graphic.stop();

 

Votes

Translate

Translate

Report

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
Contributor ,
Mar 16, 2024 Mar 16, 2024

Copy link to clipboard

Copied

i made movie clips and it worked........

couldnt it be sound1_movieclip.stop();?

thanks man

Votes

Translate

Translate

Report

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 ,
Mar 16, 2024 Mar 16, 2024

Copy link to clipboard

Copied

yes.

Votes

Translate

Translate

Report

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
Contributor ,
Mar 16, 2024 Mar 16, 2024

Copy link to clipboard

Copied

thanks man 

but where do i place this

inside de movie clip? before or after the internal movie clip action script

to i place in the timeline

give me an example

thanks

Votes

Translate

Translate

Report

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
Contributor ,
Mar 16, 2024 Mar 16, 2024

Copy link to clipboard

Copied

i need you man

 

Votes

Translate

Translate

Report

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 ,
Mar 16, 2024 Mar 16, 2024

Copy link to clipboard

Copied

place both (or more movieclips) on you main timeline.  you can then use:

 

sound1_mc.stop();

sound1_mc.play();

sound2_mc.stop();

sound2_mc.play();

etc

Votes

Translate

Translate

Report

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
Contributor ,
Mar 16, 2024 Mar 16, 2024

Copy link to clipboard

Copied

thats ok 

thanks

but where do i place?

send me a print

Votes

Translate

Translate

Report

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 ,
Mar 16, 2024 Mar 16, 2024

Copy link to clipboard

Copied

on your main timeline probably in button listeners.

Votes

Translate

Translate

Report

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
Contributor ,
Mar 16, 2024 Mar 16, 2024

Copy link to clipboard

Copied

its the first time i hear button listeners

i know a button....action for the button

but do not button listeners

what do you mean 

thanks a lot

 

Votes

Translate

Translate

Report

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 ,
Mar 16, 2024 Mar 16, 2024

Copy link to clipboard

Copied

put the code in the function your button(s) call

Votes

Translate

Translate

Report

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
Contributor ,
Mar 16, 2024 Mar 16, 2024

Copy link to clipboard

Copied

i am begining to understand

thanks

give me an example of button with the code 

do i put the code before.....lines above ou below?

send me a print with the action pannel open

with this code and the button code

just this man

thank you

Votes

Translate

Translate

Report

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 ,
Mar 16, 2024 Mar 16, 2024

Copy link to clipboard

Copied

b1_play.addEventListener(MouseEvent.CLICK, f1);

function f1(e:MouseEvent):void{
sound1_mc.play();

}

Votes

Translate

Translate

Report

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
Contributor ,
Mar 16, 2024 Mar 16, 2024

Copy link to clipboard

Copied

what about the stop

Votes

Translate

Translate

Report

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
Contributor ,
Mar 16, 2024 Mar 16, 2024

Copy link to clipboard

Copied

"b1_play" is my button?

Votes

Translate

Translate

Report

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 ,
Mar 16, 2024 Mar 16, 2024

Copy link to clipboard

Copied

i don't know how you're determining what should play and what should not.

Votes

Translate

Translate

Report

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
Contributor ,
Mar 16, 2024 Mar 16, 2024

Copy link to clipboard

Copied

there are tree buttons.........

when i play one the other two stop

 

Votes

Translate

Translate

Report

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 ,
Mar 16, 2024 Mar 16, 2024

Copy link to clipboard

Copied

var sound_mcA:Array = [sound1_mc,sound2_mc,sound3_mc];

 

var buttonA:Array= [b1,b2,b3];

 

for(var i:int=0,i<buttonA.length;i++){
buttonA[i].addEventListener etc

}

function f(e:MouseEvent):void{
var j:int =buttonA.indexOf(e.currentTarget);

for(i=0,i<buttonA.length;i++){
if(i==j){
sound_mcA[i].play();

} else {
sound_mcA[i].stop();

}

}

Votes

Translate

Translate

Report

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
Contributor ,
Mar 16, 2024 Mar 16, 2024

Copy link to clipboard

Copied

thank you man 

i am reading

Votes

Translate

Translate

Report

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
Contributor ,
Mar 16, 2024 Mar 16, 2024

Copy link to clipboard

Copied

here "buttonA[i]" is my button?    .addEventListener

Votes

Translate

Translate

Report

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 ,
Mar 16, 2024 Mar 16, 2024

Copy link to clipboard

Copied

buttonA is an array of your buttons defined towards the top of the code

Votes

Translate

Translate

Report

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
Contributor ,
Mar 16, 2024 Mar 16, 2024

Copy link to clipboard

Copied

thank you a lot

i am becoming aware

........

 

 

Votes

Translate

Translate

Report

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 ,
Mar 16, 2024 Mar 16, 2024

Copy link to clipboard

Copied

you're welcome 

Votes

Translate

Translate

Report

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
Contributor ,
Mar 16, 2024 Mar 16, 2024

Copy link to clipboard

Copied

there are tree movieclips i made

each one has its  internal code with button

do i place the name of them here? var sound_mcA:Array = [sound1_mc,sound2_mc,sound3_mc];

in the main timeline?

Votes

Translate

Translate

Report

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