This is a super simple event. Why it is not working is making me go crazy.
This is in my AsciiArt class:
dispatchEvent(new ArtEvent());
That fires this very simple event class:
package
{
import flash.events.*;
public class ArtEvent extends Event
{
public static const DONE_NOW = "done";
public function ArtEvent()
{
super(DONE_NOW);
trace("constructed");
}
}
}
I know it's firing because in my .fla where I'm instantiating an AsciiArt object it will trace "constructed" upon completion with this code:
var art:AsciiArt = new AsciiArt(bitMapData);
addChild(art)
to which I of course attach my event listener (which is what seems to not be doing anything.
art.addEventListener(ArtEvent.DONE_NOW, function():void{ trace("hi"); });
So, in summary, "constructed" will trace. But "hi" will not.
Any ideas? Thanks -J
edit - (catching the correct event type and matching num of arguments)
art.addEventListener(ArtEvent.DONE_NOW, function(event:ArtEvent) {
trace("hi");
});
Also does not work :(