FLEX, Actionscript: how can I invoke a CustomEvent ?

Posted by Patrick on Stack Overflow See other posts from Stack Overflow or by Patrick
Published on 2010-05-05T14:57:53Z Indexed on 2010/05/05 15:08 UTC
Read the original article Hit count: 120

Filed under:
|

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

© Stack Overflow or respective owner

Related posts about flex

Related posts about actionscript-3