Passing Additional Parameters To Event Listener
Here is the trick how to do that;
First configure the the listener in this way;
myComponent.addEventListener(MouseEvent.CLICK, function(e:mouseEvent):void{
var parm1:String = "First Parameter";
var parm2:String = "Second Parameter";
myClickHandler(e,parm1,parm2);
});
The write the listener function like this;
function myClickHandler(e,str1,str2):void{
trace("Parameter 1 :"+str1);
trace("Parameter 2 :"+str2);
}
Trick Always works well
About this entry
You’re currently reading “Passing Additional Parameters To Event Listener,” an entry on Flex Script
- Published:
- July 18, 2008 / 10:50 am
- Category:
- Flex
- Tags:
- ActionScript 3, Flex
3 Comments
Jump to comment form | comments rss [?] | trackback uri [?]