FLEX, Actionscript: how can I invoke a CustomEvent ?
- by Patrick
hi,
I've created a custom MouseEvent in Flex:
package {
import flash.events.MouseEvent;
public class CustomMouseEvent extends MouseEvent {
public var tags:Array = new Array();
public function CustomMouseEvent(type:String, tags:Array) {
super(type, true);
this.tags = tags;
}
}
}
Now I would like to understand how to pass the parameter tags from both Actionscript and MXML:
From actionscript I'm trying something like this, but it doesn't work:
newTag.addEventListener(MouseEvent.MOUSE_UP, dispatchEvent(new CustomMouseEvent(MouseEvent.MOUSE_UP,[newTag.name])));
From MXML i'm doing this and it doesn't work as well:
<mx:LinkButton click="dispatchEvent(new CustomMouseEvent(MouseEvent.MOUSE_UP, bookmarksRepeater.currentItem.tags))" />
thanks