FORUMS: list search recent posts

How to click on a Flash animation to play a sound file which will also stop another sound file from playing

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
casal52
How to click on a Flash animation to play a sound file which will also stop another sound file from playing
on Mar 8, 2006 at 5:59:44 pm

I am creating a project via Toon Boom Studio and Macromedia Flash 2004MX. I am creating an animated band with 5 instruments playing with animated characters playing them. The animation are very basic and were created via Toon Boom Studio and then exported as a .swf flash file.

The purpose of the project is that the band will play one combined sound file (mp3 or wave) but I need the feature that when a user clicks on one of the animated band members such as the Guitar player, the music file should stop and another music file should be played in which you can only hare the guitar playing. This feature needs to be implemented for each instrument, so when you click on the drummer you can only hare the drummer, etc. Then there will be a continue button and when you click it the combined band music file will continue to play from were it stopped.

Does anyone have a clue on what coding/action scripts should be used for this problem?


How to click on a Flash animation to play a sound file which will also stop another sound file from playing




Return to posts index

lajoiet
Re: How to click on a Flash animation to play a sound file which will also stop another sound file from playing
on Mar 8, 2006 at 9:59:43 pm

I'm assuming that you already know how to set up sound objects.

So you already have the whole band MP3 playing (we'll assume you called that sound object "wholeBand" and already have it playing, by using wholeBand.start();) and when you click on the guitar player movie clip (we'll call him "gPlayer" as an instance name) you want his MP3 file (we'll assume you called that sound object "guitarSolo" and have not started it playing yet) to play and wholeBand.mp3 to pause.

gPlayer.onRelease = function() {
audHolder.stop();
guitarSolo.start();//put parameters in the parenthases if you want it to offset or loop a number of times
}


Then for the resume button, just reverse the actions, stop the guitarSolo and start the wholeBand.

>Todd
_____________________________________

I'm filling a need. Without me there would be no bad examples.
_____________________________________


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]