I have a custom class that extends the MovieClip class. The library linked mc, is an empty mc. The class uses the drawing API to create the visual content on the stage.
I am having issues defining MovieClip events. The constructor looks like:
public function Shape (target_mc:MovieClip, depth:Number, paramObj:Object) {
name = Type + "_" + depth;
__mc = this;
__mc = target_mc.attachMovie ("Shape", name, depth);
//do drawing API stuff with paramObj
}
then on the stage I am trying to do this:
var s:Shape = new Shape (some_mc, someDepth, {...});
s.onRelease = function () {
trace ("released");
}
So I am not sure how to proceed. I was thinking about using a decorator pattern to somehow define the mc events, but I would assume there is something super simple that I am overlooking.
Any help is much appreciated. Thank you.