Hey, I’m creating an mp3 player with playlist, equalizer etc.
I’ve worked with an equalizer before, however I want this equalizer to display outside of the playlist movie clip where all the track information is stored.
So this is my code:
addEventListener(Event.ENTER_FRAME, onEnterFrame);
function onEnterFrame(event:Event):void {
// ANIMATED EQ BARS CODE
eqBarLeft1.gotoAndStop (Math.round(MovieClip(root).wholenano.tracks.sndChannel.leftPeak * 10) );
eqBarRight1.gotoAndStop (Math.round(MovieClip(root).wholenano.tracks.sndChannel.rightPeak * 8) );
eqBarLeft2.gotoAndStop (Math.round(MovieClip(root).wholenano.tracks.sndChannel.leftPeak * 7) );
eqBarRight2.gotoAndStop (Math.round(MovieClip(root).wholenano.tracks.sndChannel.rightPeak * 7) );
eqBarLeft3.gotoAndStop (Math.round(MovieClip(root).wholenano.tracks.sndChannel.leftPeak * 8) );
eqBarRight3.gotoAndStop (Math.round(MovieClip(root).wholenano.tracks.sndChannel.rightPeak * 10) );
}
The song information is stored in the tracks movie clip under the sndChannel - which I believe the script is locating correctly (I know this because if I change it slightly I get undefined sndChannel errors).
However I get an:
A term is undefined and has no properties.
at nano_fla::equalizer_22/onEnterFrame()
error. So something is wrong with the onEnterFrame event. I’ve tried removing this but I then get a slightly different undefined error.
Any help would be much appreciated, thanks!