First time here? First time here? Newsletter Signup Newsletter
651326 Members and growing! | Flash Jobs
Search tutorials
Author: Agamemnon | Website: http://mootpoint.20m.com

Step by Step

Note : Words in green are just names and values that you can change them with your own.
  1. Press Ctrl+R to import a sound file, open your library and right-click on it.
    Select "Linkage...", "Export this symbol", enter "Loop" in the "Identifier" box and press OK.


  2. Press Ctrl+F8 to make a new movie clip and name it fadeOutMC.


  3. Select the 100th frame of fadeOutMC and press F6 to create a keyframe.
    Double-click on it and in the Actions panel enter stop ();


  4. Return to the main timeline.
    Double-click on frame 1 and enter the following :
    myMusic = new Sound();
    myMusic.attachSound("Loop");
    myMusic.start( 0, 1000 );
    
    Meaning : We create a new sound object (myMusic), attaching our "Loop" sound and make it play 1000 times.


  5. Select frame 30 and press F6 to create a new keyframe.
    Drag fadeOutMC from the library to the stage.
    Then select frame 31 and press F6 again.
    Double-click on it and in the Actions panel enter stop (); (to prevent the movie from looping in testing mode).
    On the stage right-click on fadeOutMC (a small cross) and select "Actions".
    Enter the following :
    onClipEvent(enterFrame) {
            volumeValue = 100 -  _currentframe;
            _root.myMusic.setVolume(volumeValue);
    }
    
    What we do is :
    On the 30th frame our fadeOutMC starts playing.
    Since it's a movie clip it won't stop at the next frame, but it will play untill it reaches a stop() in its own timeline (the 100th frame).
    Then we set a variable (volumeValue) and its value is 100 minus the frame fadeOutMC currently is.
    This value decreases as fadeOutMC plays.
    Then we set the volume to our sound object to the value of our volumeValue variable.


  6. Test your movie.
    After it gets to the 30th frame the music will fade out.
» Level Intermediate

Added: 2001-12-20
Rating: 8.87 Votes: 163
(10 being the highest)
» Author
Agamemnon lives in Greece. He is a professional musician (a Double Bass player) and a semiprofessional web author. He loves working with Flash while what hates the most is the incompatibility between browsers.
» Download
Download the files used in this tutorial.
» Forums
More help? Search our boards for quick answers!

Comments

  • There are no comments yet. Be the first to comment!

  • You must have javascript enabled in order to post comments.

Leave a Comment
  • Your email address will not be published. All fields are required.
Featured Flash FLA
» Author: work2survive
» Title: Girl Walking 1kb
» Description: Walking girl, animation just takes 1kb, using high heels shoes, and fashion model attitude.
Featured Sound Loops
Image for equalize

Audio Player

» Author: BoxCat
» Title: CPU Talk
» Description: From the cyberpunk RPG, "Nameless: the Hackers" Completely Free to use! Keywords: edm hip hop rap electronic mysterious mission hacking chase exciting spy ios ambient chilling love happy sad angry suspense
Latest Font
» Author: Fábio FAFERS
» Description: I created this font for free use. Everyone can apply it in personal or business texts. Its free, but I want to be communicated in case of business use. Donations are accepted to keep the project of free fonts alive! Thank you all
Featured Sound Fx
Image for equalize

Audio Player

» Author: nathan
» Description:

A recorded sound of the Dimensional Fork Gate.