# Listener prob

**URL:** <https://forum.kirupa.com/t/listener-prob/214443>\
**Category:** flash\
**Created:** [January 29, 2007, 3:06am UTC](https://forum.kirupa.com/t/listener-prob/214443 "2007-01-29T03:06:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![esper](https://avatars.discourse-cdn.com/v4/letter/e/e9bcb4/32.png) [@esper](https://forum.kirupa.com/u/esper)\
**Post date:** [January 29, 2007, 3:06am UTC](https://forum.kirupa.com/t/listener-prob/214443/1 "2007-01-29T03:06:27Z")

</div>

Im a newb obviously. Just trying to get my head wrapped around event listeners. In the test class below, I can get the button onRelease to trace out but nothing happens. Any advice?

I have attached the class to a mcContainer clip in the the FLA.

import mx.transitions.Tween;  
import mx.events.EventDispatcher;

==========================================  
class Test extends MovieClip {

var box:MovieClip;  
var button:MovieClip;  
var listenerObject:Object = new Object();

public var addEventListener:Function;  
public var removeEventListener:Function;  
public var dispatchEvent:Function;

function Test (){  
EventDispatcher.initialize(this);   
onLoad();  
trace(“asdfsdfs”);  
setMouseEvents();

}

public function onLoad():Void  
{

box.addEventListener(“click”, this.box);  
button.addEventListener(“click”, this.button);

}

function setMouseEvents () {

this.button.onRelease = function(evt) {  
trace(“button hit”);  
activate();

//var eventObject:Object = new Object;  
//dispatchEvent(eventObject);  
}

}

function activate() {  
trace(“activated”);  
this.button.\_alpha = 0;  
}

public function click(event:Object):Void {  
activate();  
}

}
