-
Expression...7
OK so here's the deal, I have 3 scenes
Scene 1,
s = new Sound();
s.attachSound("music");
s.start(0, 1);
Scene 2,
Music carries on from scene 1 in the library, I have
a pause and the user clicks a button..things fade out, then have an action on the last frame which is;
s.stop();
"This works fine.."
Question.. Can this be faded out instead of just cutting out??
Cheers Ears..
-
while (_global.Music.getVolume()>0) {
starttime = getTimer();
while (getTimer()<starttime+20) {
}
_global.Music.setVolume(_global.Music.getVolume()-1);
}
in the button should do the trick
cheers
-
Expression...7
Cheers for that dude, still doesn't workthough...
the code needs to be in the frame and not a button, would this make a difference?
Cheers
-
This might work
Code:
// replace song with your sound's name
function fadeSound(){
if (song.getVolume() > 0){
song.setVolume(song.getVolume() - 10);
trace(song.getVolume()); // used for debugging
}
else {
clearInterval(counter);
}
}
place this on the frame where the fade should occur.
Code:
counter = setInterval(_root.fadeSound, 500);
That code will create an Interval such that the function is run every half second (500 milliseconds) and the function reduces the volume of the sound by 10 each time it is called.
-
Expression...7
Where ddo you put the first bit of code?
Is it in the button or on the frame?
Cheers dude
-
First frame should do, right below where you started the sound.
Here's what my first frame looks like:
Code:
song = new Sound(); // new sound object
song.attachSound("music"); //sound in the library export to action with name music
song.start(); //get the groove going (play the sound)
function fadeSound(){
if (song.getVolume() > 0){
song.setVolume(song.getVolume() - 10);
trace(song.getVolume());
}
else {
clearInterval(counter);
}
}
-
sound volume
See now that turns down the volume on all my sounds. Why doesn't it distinguish between them? I've had this similar problem with sound in my other movies too.
-
Expression...7
I don't know why but its still not working I have the code in the first frame of scene 1, and the second bit of code in a frame after a button in scene 2,
I take it you can cross scenes with this code??
cheers people..
-
Expression...7
Ok so I have got it to work but it just suddenly decreases the volume to a whisper.. It doesn't fade out gradually..?
Cheers
-
Check this:
How to Fade a Sound Object Up or Down
Here:
http://www.kennybellew.com/
-
Expression...7
-
Expression...7
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|