Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

best way of fading in/out music

Status
Not open for further replies.

iostream71

Programmer
Mar 13, 2002
229
US
i'm using a sound object to control music in the background. i have a button to turn it on and off, but i want the music to fade in/out. can i just use a for loop and the setVolume function to do that or is it bad design?

fade in like this:

for(i = 0; i<= 100; i++)
soundObject.setVolume(i);
 
If it works... Why should it be bad design?
The question should be... Doest it work?

Regards,
new.gif
 
weeeell, there's good ways to do things and bad ways. just wanted to know if that's a common way to do it
 
If it doesn't work, then I guess it's a bad way!
If it does... Well, might be better ways, but that way is working, ain't it?
Once again does it work?

BTW, if you're streaming this sound, Macromedia is presently working on a big bug with the Flash player 6. Streaming of a file, once started, can't be stopped, even if you move on to another site, thus a major problem for slow connected users.
They've put out a new player on Thursday or so, but have since pulled it off again... Other side effects!

Regards,
new.gif
 
nah, doesn't work. not sure why. even if i manually set volume in increments of 5.

onClipEvent(load){
sLoop = new Sound(this);
sLoop.attachSound(&quot;loop1&quot;);
sLoop.setVolume(0);
sLoop.start(0,100);
sLoop.setVolume(5);
sLoop.setVolume(10);
etc..
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top