How to detect on which CCSprite has been clicked?

Hi all!
My main screen is Main.ccbi, it contains 3 CCSprite. Now I want that when user clicks on a CCSprite I should know on which he has clicked?
I want to calculate in CCMotionBegin method that on which CCSprite user has clicked.

I am working in cocos2d-X.

To detect click you need to implement OnTouchesEnded or onTouchesBegin method.

Since you are using cocos builder to create a menu(I think it’s that you are doing), don’t use CCSprite. use a CCMenu with CCMenuItemImage as a child.

Put the code that you are using, it will be easier to help you.

I figured it out.
Thanks for reply