# As3 equalizer & volume control help needed!

**URL:** https://forum.kirupa.com/t/as3-equalizer-volume-control-help-needed/327489
**Category:** flash
**Created:** [March 4, 2012, 9:46pm UTC](https://forum.kirupa.com/t/as3-equalizer-volume-control-help-needed/327489 "2012-03-04T21:46:01Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![bigbox](https://avatars.discourse-cdn.com/v4/letter/b/b4bc9f/32.png) [@bigbox](https://forum.kirupa.com/u/bigbox)
#### Post date: [March 4, 2012, 9:46pm UTC](https://forum.kirupa.com/t/as3-equalizer-volume-control-help-needed/327489/1 "2012-03-04T21:46:01Z")

</div>

I was wondering if somebody could help me adding an equalizer and volume control for the following code.

```auto
//number that is redefined when the pause button is hit
var stopPoint:Number = 1;
//a true or false value that is used to check whether the sound is currently playing
var isPlaying:Boolean;

//think of the soundchannel as a speaker system and the sound as an mp3 player
var soundChannel:SoundChannel = new SoundChannel();
var sound:Sound = new Sound(new URLRequest("demo.mp3"));

//you should set the xstop and xplay values to match the instance names of your stop button and play/pause buttons
xstop.addEventListener(MouseEvent.CLICK, clickStop);
xplay.addEventListener(MouseEvent.CLICK, clickPlayPause);

soundChannel = sound.play();
isPlaying = true;

function clickPlayPause(evt:MouseEvent) {
    if (isPlaying) {
        stopPoint = soundChannel.position;
        xplay.gotoAndStop(2);
        soundChannel.stop();
        isPlaying = false;
    } else {
        soundChannel = sound.play(stopPoint);
        isPlaying = true;
        xplay.gotoAndStop(1);
    }
}

function clickStop(evt:MouseEvent) {
    if (isPlaying) {
        soundChannel.stop();
        isPlaying = false;
    }

}

```
