A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Fade in & out sound

  1. #1
    Vox = Voice Vox98's Avatar
    Join Date
    Mar 2001
    Posts
    879
    Question: I have a music player in my movie, with 4 songs and wanted to know how to fade in the songs and have them fade out when changed. I haven't worked with sound much and Im not to experienced with it. Easy?

    Tried posting in the sound forum but no luck.

  2. #2
    Senior Member
    Join Date
    May 2002
    Posts
    248
    If you're using attached sounds, then it's not so hard to fade the volume. If the sounds are in a timeline, then I think it's not even possible to do a fade. So let's say you've attached a sound to an object called objBeep. You can set its volume to anything from 0 to 100 with setVolume like this<pre>objBeep.setVolume(50);</pre>That'll set the volume to 50%. So all you gotta do to make a fade is to make an enterFrame event like this (for a fade out)<pre>onClipEvent(enterFrame) {
    if (objBeep.getVolume() > 0) {
    objBeep.setVolume(objBeep.getVolume()--);
    } else {
    //Fade is done
    }
    }</pre>
    -Dan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center