Copy link to clipboard
Copied
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?
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();
Copy link to clipboard
Copied
i made movie clips and it worked........
couldnt it be sound1_movieclip.stop();?
thanks man
Copy link to clipboard
Copied
yes.
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
Copy link to clipboard
Copied
i need you man
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
Copy link to clipboard
Copied
thats ok
thanks
but where do i place?
send me a print
Copy link to clipboard
Copied
on your main timeline probably in button listeners.
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
Copy link to clipboard
Copied
put the code in the function your button(s) call
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
Copy link to clipboard
Copied
b1_play.addEventListener(MouseEvent.CLICK, f1);
function f1(e:MouseEvent):void{
sound1_mc.play();
}
Copy link to clipboard
Copied
what about the stop
Copy link to clipboard
Copied
"b1_play" is my button?
Copy link to clipboard
Copied
i don't know how you're determining what should play and what should not.
Copy link to clipboard
Copied
there are tree buttons.........
when i play one the other two stop
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();
}
}
Copy link to clipboard
Copied
thank you man
i am reading
Copy link to clipboard
Copied
here "buttonA[i]" is my button? .addEventListener
Copy link to clipboard
Copied
buttonA is an array of your buttons defined towards the top of the code
Copy link to clipboard
Copied
thank you a lot
i am becoming aware
........
Copy link to clipboard
Copied
you're welcome
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?