This content has been marked as final. Show 6 replies
In ActionScript, event listeners are added using addEventListener(). Try something like this:
mWin = PopUpManager.createPopUp(this,MessageBox,true);
Yea that is how I thought it should be added, but nothing happens.
Is the event dispatched Globally?
It was a problem with ny name in the event metadata
I thought it could be anything, but appearently it has to match the name in the Event.
So when using addEventListener, it is different then using an event in a component. The Metatdata tag I put in my messageBox component didn't do anything, and the event I had to listen for is the one defined by in my custum event class.
Don't I feel like a fool, you have to use the name specified in the event creation,
var eventObj:Event = new Event("regAdded");
In the listener...
The name given in the Metadata tag is just used in the MXML so that the compiler can validate it as a valid attribute (and for code completion and the like). It has no effect over what the ActionScript code does (which can dispatch events named whatever it wants).