# Sound Fade Out Code..?

**URL:** <https://forum.kirupa.com/t/sound-fade-out-code/123611>\
**Category:** Uncategorized\
**Created:** [September 25, 2004, 6:32am UTC](https://forum.kirupa.com/t/sound-fade-out-code/123611 "2004-09-25T06:32:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tanvi](https://avatars.discourse-cdn.com/v4/letter/t/9de053/32.png) [@tanvi](https://forum.kirupa.com/u/tanvi)\
**Post date:** [September 25, 2004, 6:32am UTC](https://forum.kirupa.com/t/sound-fade-out-code/123611/1 "2004-09-25T06:32:06Z")

</div>

[http://kennybellew.com/tutorial/#fade](http://kennybellew.com/tutorial/#fade)

on the 1st frame i have this code;  
[size=2][color=#808000]mySound = new Sound();  
mySound.attachSoundmyMusic.mp3");  
pausedPosition = 0;  
mySound.start(0, 1);  
this.onEnterFrame = function() {  
//Fade Out  
if (fadeOut01 == 1) {  
\_root.myLoop.setVolume(myLoopVolume);  
myLoopVolume = myLoopVolume-5;  
if (myLoopVolume\<5) {  
\_root.myLoop.stop("\_jUsT-Rudy\_Ves-8003\_hifi.mp3");  
fadeOut01 = 0;  
}  
}  
};  
[color=black][/color]  
[color=black]On the 30th frame i have this code:[/color]

[size=2][color=#808000]mySound.stop();  
this.onEnterFrame = function() {  
//Fade Out  
if (fadeOut01 == 1) {  
\_root.myLoop.setVolume(myLoopVolume);  
myLoopVolume = myLoopVolume-5;  
if (myLoopVolume\<5) {  
\_root.myLoop.stop(“myMusic.mp3”);  
fadeOut01 = 0;  
}  
}  
};

[color=black]and again from 31st frame i have another sound playing.[/color]  
[color=black]so i have given the fade out AS to the sound but i dont see any change in the sound when it is playing? Here i have applied on both firts and last frame?..is it correct doing so?[/color]  
[color=black][/color]  
[color=black]Where am i going wrong?[/color]  
[color=black][/color]  
[color=black]pls masters, help me[/color]  
[/color][/size][/color][/size]
