# Help with fade in sound

**URL:** <https://forum.kirupa.com/t/help-with-fade-in-sound/63695>\
**Category:** Uncategorized\
**Created:** [September 9, 2004, 6:56am UTC](https://forum.kirupa.com/t/help-with-fade-in-sound/63695 "2004-09-09T06:56:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pixeldude](https://avatars.discourse-cdn.com/v4/letter/p/57b2e6/32.png) [@pixeldude](https://forum.kirupa.com/u/pixeldude)\
**Post date:** [September 9, 2004, 6:56am UTC](https://forum.kirupa.com/t/help-with-fade-in-sound/63695/1 "2004-09-09T06:56:06Z")

</div>

Can anyone tell me how to fade in sound using AS…i just try using coding inside [http://www.kennybellew.com/tutorial/](http://www.kennybellew.com/tutorial/) website but it still not working so can anyone help me?..

thx…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 9, 2004, 12:30pm UTC](https://forum.kirupa.com/t/help-with-fade-in-sound/63695/2 "2004-09-09T12:30:27Z")

</div>

on (load){  
a=0;  
speed=5;  
}  
on (enterFrame){  
if (a\<100){  
a=(a+speed)  
YourSoundObject.setVolume(a);  
}  
}

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 10, 2004, 2:02am UTC](https://forum.kirupa.com/t/help-with-fade-in-sound/63695/3 "2004-09-10T02:02:07Z")

</div>

ELLO CAMERAMANO…tx for ur reply anyway…i just modified ur code then i put in frame

```auto

bkgMusic = function () { 
 a=0;  	
speed=5; 
 mySound = new Sound(this); 
 mySound.attachSound("sound2");
 mySound.start(0, 3); 
 mySound.setVolume(80);
   	if(a<80){
  	   a+=speed;  		
           mySound.setVolume(a); 
 	}
  };
  bkgMusic();

```

it’s seem the sound not start at all…so is it something wrong with my code…any help would be greatful…thx…
