# Equaliser

**URL:** https://forum.kirupa.com/t/equaliser/327786
**Category:** Uncategorized
**Created:** [March 28, 2012, 6:41pm UTC](https://forum.kirupa.com/t/equaliser/327786 "2012-03-28T18:41:22Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![rakesh74](https://avatars.discourse-cdn.com/v4/letter/r/6de8d8/32.png) [@rakesh74](https://forum.kirupa.com/u/rakesh74)
#### Post date: [March 28, 2012, 6:41pm UTC](https://forum.kirupa.com/t/equaliser/327786/1 "2012-03-28T18:41:22Z")

</div>

Hi

i have an equalizer .when i press crt+enter the music equalizer and the song starts playing. I want the following :-

(i) when i click on the playing equalizer it stops  
(ii) when i click on the stop equalizer it resumes playing.

Here is my as code

var \_sound :Sound = null;  
var \_soundChannel :SoundChannel = null;

\_soundChannel = new SoundChannel();  
\_sound = new Sound(new URLRequest(“song.mp3”));  
\_soundChannel = \_sound.play();

addEventListener(Event.ENTER\_FRAME, Update, false, 0, true)

function Update($e:Event):void  
{  
\_equalizer.\_eq1.gotoAndStop (Math.round(\_soundChannel.leftPeak \* 5) );  
\_equalizer.\_eq2.gotoAndStop (Math.round(\_soundChannel.rightPeak \* 3) );  
\_equalizer.\_eq3.gotoAndStop (Math.round(\_soundChannel.leftPeak \* 3) );  
\_equalizer.\_eq4.gotoAndStop (Math.round(\_soundChannel.rightPeak \* 5) );  
}

thanks

rakesh
