slemmon
26 Jan 2012, 10:23 PM
I've got a draw component with 50 sprites on the draw surface. I'm wanting to capture click events on the sprites. What is the best way to go about it?
I tried the following on the draw component:
listeners: {
el: {
click: {
fn: function (e) {
console.log()
}
, delegate: 'path'
}
}
I get a click registered on the sprite, but I'm not sure how to get access to the sprite object itself to all the properties and methods and whatnot. I can add a listener to each sprite, but wanting to add less click listeners if possible.
I tried the following on the draw component:
listeners: {
el: {
click: {
fn: function (e) {
console.log()
}
, delegate: 'path'
}
}
I get a click registered on the sprite, but I'm not sure how to get access to the sprite object itself to all the properties and methods and whatnot. I can add a listener to each sprite, but wanting to add less click listeners if possible.