Go to Content
Columbia College Chicago
IAM Wiki: Flash Sound and Volume part 2
Flash Sound and Volume part 2

Make a button to play a sound

Draw something for the play button

Image:FlashVol_DrawPlay.png

Select the play button. Use the Solid Black arrow.

Convert the selection to a symbol (right click or Modify/Convert ot Symbol or f8). Select button and export for action script. Name the button btnPlay

Image:FlashVol_DrawPlayConvertToSymbol.png

Image:FlashVol_DrawPlayConvertToSymbolName.png

Name the instance. Go down to the properties section and name the instance of the button 'btnPlay'

Image:FlashVol DrawPlayConvertToSymbolNameInstance.png

Click back on the first frame.

Image:FlashVol_ClickOnFrame1.png

Copy the following code to the script for frame 1

 
btnPlay.onRelease = function() {
    //Play the sound 1000 times
    mySound.start(0,1000); 
};

Save the file and press ctr+enter to test the movie you should now have a botton that start the sound.


Draw a stop button

use the steps above to convert it to a button

name the stop button btnStop

the followong code will stop the sound

 
btnStop.onRelease = function() {
    //Stop playing the sound
    mySound.stop(); 
};
This page was last modified on 4 August 2008, at 20:53. This page has been accessed 1,224 times. About IAMMediaWiki Powered by MediaWiki