# What is wrong with this code?

**URL:** <https://forum.kirupa.com/t/what-is-wrong-with-this-code/232310>\
**Category:** Uncategorized\
**Created:** [July 12, 2007, 5:26pm UTC](https://forum.kirupa.com/t/what-is-wrong-with-this-code/232310 "2007-07-12T17:26:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Louis777](https://avatars.discourse-cdn.com/v4/letter/l/bc8723/32.png) [@Louis777](https://forum.kirupa.com/u/Louis777)\
**Post date:** [July 12, 2007, 5:26pm UTC](https://forum.kirupa.com/t/what-is-wrong-with-this-code/232310/1 "2007-07-12T17:26:07Z")

</div>

Hi all, this is my code:

```auto

var request:URLRequest=new URLRequest("firstsound.mp3");
var snd1:Sound=new Sound();
snd1.load(request);
var song:SoundChannel=snd1.play();
song.addEventListener(Event.SOUND_COMPLETE, onPlaybackComplete);

function onPlaybackComplete(event:Event)
{
      bttn_snd2.visible = true;
      bttn_snd3.visible = true;
}

```

I get the following error output when I execute this code:

TypeError: Error #2007: Parameter listener must be non-null.  
at flash.events::EventDispatcher/addEventListener() at MethodInfo-218()

Please help, the AS3 manual is not very helpfull

Thanks,

Louis
