How to bind a sprite not the entire layer to touch events?

I add a sprite to a layer(Dog added to Layer1), and i want the dog barks when it touched.
var Dog = cc.Sprite.extend({
onEnter:function () {
cc.TouchDispatcher.sharedDispatcher().addTargetedDelegate(this, 0, true);
this.*super;
},
onExit:function {
cc.TouchDispatcher.sharedDispatcher.removeDelegate;
this.*super();
},
ccTouchBegan:function (touch, event) {
alert(‘Barks!’);
return false;
}
})
No matter where i click on layer, ccTouchBegan was called ,it barks.

i looked into some examples, it seems i have to add another function to see whether the dog is under the touch point, then call the function “alert(Barks!)”.

I’m confused, it was the Dog that i want to receive the touch event not the entire layer. Where went wrong, something i missed?

For now, look into the touch test in the test cases
alternatively, you can use CCMenuItem that have touch/click methods built in, you can borrow the implementation from there to your sprite, or you can just use CCMenuItem