The Kinetic object eventing system (.on) takes only 2 parameters
- the event type to listen for (eg "click")
- the callback function
In the callback this
is the Kinetic object.
Therefore, you can set a property on the object that will be accessible inside the callback.
topBtn.param="hello";
topBtn.on("click",function(){ alert(this.param); }); // click alerts "hello"