Help - Search - Member List - Calendar
Full Version: Sync music fade with animation ending.....
WorkTheWeb Forums > Webmaster Resources > Macromedia Flash
Support our Sponsors!
Is there a way to fade the music at the end of a presentation? Since there are so many platforms out there that play the presentation at different speeds. I want to be able to insert some code at the end so what ever the final speed the animation and music will end together.

You can view the file at http://www.andruk.com/public/RRflash.fla.zip

KA

Hi!

First, you should think about starting the music via actionscript:

- Save RRIntroFINALMIX.mp3 on the server - in full length and without an outfading end.
- Delete the .mp3-file from your Flash-file. It makes it rather large...
- At the beginning of your flashfile (1st frame or so) insert the following code:

soundsource = "http://professionell.info/mailer/01.mp3";
_root.presentationsound = new Sound(this);
_root.presentationsound.loadSound(soundsource,true);
_root.presentationsound.start(startOffX,1);


Check it out now. Does it work properly? The swf-File should be some bytes smaller, because the sound is added to the movie at runtime.

Now let's go to the fading:

Insert some empty symbol with the following code:
onEnterFrame = function() {
if (_global.fade_out && _root.presentationsound.getVolume()!=0) {
_root.presentationsound.setVolume(_root.presentationsound.getVolume() - 5);
}
}
This function lets decrease the volume - 5% per played frame. To call it, simply insert an "_global.fade_out = true" at the point where you want to start the fading. Let's say about 20 frames before the end...

Have fun!
Daniel

tralfaz
Only one problem.. start is for event sounds, not streaming sounds.
tf

"dcc*" <[Email Removed]> wrote in message
news:blq4q9$8ui$[Email Removed]...
QUOTE
Hi!

First, you should think about starting the music via actionscript:

- Save RRIntroFINALMIX.mp3 on the server - in full length and without an
outfading end.
- Delete the .mp3-file from your Flash-file. It makes it rather large...
- At the beginning of your flashfile (1st frame or so) insert the
following code:

soundsource = "http://professionell.info/mailer/01.mp3";
_root.presentationsound = new Sound(this);
_root.presentationsound.loadSound(soundsource,true);
_root.presentationsound.start(startOffX,1);


Check it out now. Does it work properly? The swf-File should be some bytes
smaller, because the sound is added to the movie at runtime.

Now let's go to the fading:

Insert some empty symbol with the following code:
onEnterFrame = function() {
if (_global.fade_out && _root.presentationsound.getVolume()!=0) {
_root.presentationsound.setVolume(_root.presentationsound.getVolume() -
5);
}
}
This function lets decrease the volume - 5% per played frame. To call it,
simply insert an "_global.fade_out = true" at the point where you want to

start the fading. Let's say about 20 frames before the end...
QUOTE

Have fun!
Daniel




PHP Help | Linux Help | Web Hosting | Reseller Hosting | SSL Hosting
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2006 Invision Power Services, Inc.