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();
}
}