Link to home
Start Free TrialLog in
Avatar of encosion
encosion

asked on

fading the volume of all non-looping event sounds in an mc or root?

   hello ..i require some assistance : i have a looping animation assigned to each section of my site { a dog performing various tricks } ..with each animation come various miscellanious soundFX triggered on event ..what i would like to have happen after a certain time period { which can be specified by x number of frames if necessary } / once the animation has run through the loop two or three times ..i'd like all sounds relating to this animation / mc ONLY to fade out so as not to annoy the end user ..is this possible .[?]..

    i have tried to adapt a few 'fade out' tutorials but they only tend to effect looping sounds... .. .

    the solution to this question would be a very handy piece of script because it could be adapted to fade out all the root mc sounds too { presumeably } which is indeed handy 'cos that would mean that the end user can effectivly turn off { fade out } ALL sounds - rollover soundFX etc NOT just the background music... .. .

    please advise

    much appreciated

    tim ferguson
    the aural encosion theory
                ___  __  _
         S;'~~
       `;s;._
         `"ýSs,
              `~$S:
                 .sS'
 .s%Ss. _..s$ý'
$ý' `ý"s
`.
Avatar of Ninfox
Ninfox

This is one way you can do it. One the MC Dog or whatever, make three keyframes. Whereever you press the button, add that to the MC. Add it so on the button it goes to the next frame. Then add a fourth one that goes back to the third. On the third one make the sound lower or whatnot. I think that solves your problem.
Avatar of rascalpants
you could make a movieclip that when initiated would have code in each frame that would steadily lower the volume of the specific movieclip sound...

something like this in every frame:

n--;
audioclip.setVolume(n);

or you coule decrease the value by multibles of 2 or 5 or what ever...  for the above code, it would take 100 frames to fade all of the way out...

you could use just one clip for this and use variables to set the name of the audio clip that is playing and then same for the fade out...


this is just one sneaky way to do it...

you should adapt it into your own code, and try to explore the possibilities...



rp

if u are using mx, u can have the sound start, stop, fade ... anytime a particular frame, loop once, or twise then stop ... anything u want :)

Avatar of encosion

ASKER

thank you for your comments however i don't think the question has been understood : in each looping mc where the dog performs a trick, there are several 'one shot' sounds triggered on event ..these sounds are very short and do not loop { for example when the dog drops the ball a bounce / boing sound is triggered } ..there are several short 'one shot' sounds triggered in each animation... .. .

my experience of the sound object setVolume() is that it only sets the volume of a specific sound that is already playing / looping ..NOT the global volume of the mc or root so that all new sounds triggered are affected by the volume change... .. .

any ideas .[?]..
you can just put all of the sounds in a movieclip and use the setVolume() if that is what you need...

do you want to mute the entire movie or just a sound clip?


entire movie = stopAllSounds();
movieclip = setVolume();


what do you want to do?

rp
ASKER CERTIFIED SOLUTION
Avatar of henryww
henryww

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thank you ..henryww : at a glance this looks like the solution ..thank you very much ..i'll put it together and play around until i get it working ..i'll be back to let you all know how it turned out and to 'award the points to the winner!' ..heheh ..thanks again... .. .
thank you very much ..however there is an unfortunate side effect to this solution : actionscript doesn't really allow you to set in, out and envelope points which is what i was using to recycle some of my sounds without sound the same ..so unfortunately i can't use this technique in my presentation.... .. . the soundoffet value is pretty useless too as it will only accept whole numbers which are far from precise ..does anyone ever even use this function .[?]..
yeah, the offset only works for whole number (sec)
hmmm ... but i don't quite understand how u recycle the sound ...

what i mean is i can get more mileage out of an individual sound clip by using it several times with different in, out and envelope points for each instance ..for example the sound of a ball bouncing can be used twice for two different sound effects ..one without any adjustments to reprasent the sound effect of a ball bouncing ..and another instance can reprasent the sound of the ball when it stops ..or lands on something hard { by tweaking the in, out and envelope points }... .. .