Hello All-
I’ve created an MC to control the various sounds throughout my flash file. I’m sure this is an ugly way to do things (in AS 2.0) and would appreciate a better suggestions, but barring that, here’s what I’m trying to do, and what I got at the moment:
I need one of several sound clips to play (1-4) depending on a particular frame that’s reached. If, during the sound playback, a user clicks a navigation button, I need the sound to quickly fade out (and I’m assuming have the sound object stopped or destroyed to preserve resources?), so my _root mc targets a frame within my SOUND mc and creates the ‘standard’ sound object:
VO_mobile = new Sound(mobilesound);
VO_mobile.attachSound("vo_mobile");
VO_mobile.setVolume(20);
VO_mobile.start();
The sound then plays. To get the sound to stop, the nav button is clicked, and the very next frame simply calls
VO_mobile.stop();
I have created a truckload of frames (1 of each of these for every sound file!) and am looking to change the “stop();” command to a fadeout command.
So, aside from the aforementioned ugliness of going this route, how do I tell the sound object to fade out and stop once it’s hit that frame that normally tell the sound to simply stop?
If there is a ‘cleaner’ way of pulling this off I’d much appreciate it. I’ve tried using variations of sound object code I’ve found throughout the Kirupa (and other) website(s), but they don’t end up meeting my specific needs, and I just don’t quite seem good enough to ‘tweak’ for my needs.
Thanks in advance,
-D