# Fading sound via actionscript

**URL:** https://forum.kirupa.com/t/fading-sound-via-actionscript/169962
**Category:** flash
**Created:** [November 21, 2005, 5:04pm UTC](https://forum.kirupa.com/t/fading-sound-via-actionscript/169962 "2005-11-21T17:04:14Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Pierce\_Bronkite](https://avatars.discourse-cdn.com/v4/letter/p/258eb7/32.png) [@Pierce\_Bronkite](https://forum.kirupa.com/u/Pierce_Bronkite)
#### Post date: [November 21, 2005, 5:04pm UTC](https://forum.kirupa.com/t/fading-sound-via-actionscript/169962/1 "2005-11-21T17:04:14Z")

</div>

Is it possible to fade sound using actionscript? I am currently using the actionscript:

> 

```
//Play Internal Sound Behavior
if(_global.Behaviors == null)_global.Behaviors = {};
if(_global.Behaviors.Sound == null)_global.Behaviors.Sound = {};
if(typeof this.createEmptyMovieClip == 'undefined'){
    this._parent.createEmptyMovieClip('BS_distant',new Date().getTime()-(Math.floor((new Date().getTime()) /10000)*10000) );
    _global.Behaviors.Sound.distant = new Sound(this._parent.BS_distant);
} else {
    this.createEmptyMovieClip('_distant_',new Date().getTime()-(Math.floor((new Date().getTime()) /10000)*10000) );
    _global.Behaviors.Sound.distant = new Sound(this.BS_distant);
}
_global.Behaviors.Sound.distant.attachSound("distant");
if (true) {
    _global.Behaviors.Sound.distant.start(0,2);
}
//End Behavior

```

You can see here that I have it looping twice but want to fade it out in the end. Can someone please point me in the right direction? Did a search but nothing helpfull came out.

Thank you very much.
