While configuring the event listeners for the a component, some time we want to pass additional parameters to the event listener.
Here is the trick how to do that;
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
thanks!
Thanks Srikant this problem was causing me a lot of trouble.
Bravo! This is a tough one to figure when you first want to do it in a project…thanks…
Thanks very much!!!