title: Detecting which extended sprited i touched
body: <p>I want detect which object of Card I touched. Card is custom Class which extends cocos Sprite.</p>
  
  <p>I would like to call member methods on card. Something like this: if (target is Card) target.openCard();</p>
  
  <p>Thank you very much in advance.</p>
  
  <p>Main Class Body</p>
  
  <pre><code>bool HelloWorld::init()    
  {
  
  ... some init code, generating card arrays, shuffling
  
  // draw memory cards
  int count = 0;
  
  for (int i = 0; i &lt; 5; i++)
  {
      for (int j = 0; j &lt; 4; j++)
      {
          auto card = Card::createCard();
          card-&gt;customInit(cardsPictures[count]);
          this-&gt;addChild(card);
  
          card-&gt;setPosition(100 + i*100, 600 - j*100);
  
          count++;
      }
  
  }
  
  // register event listener
  auto touchListener = EventListenerTouchOneByOne::create();
  
  touchListener-&gt;onTouchBegan = CC_CALLBACK_2(HelloWorld::onTouchBegan, this);
  touchListener-&gt;onTouchEnded = CC_CALLBACK_2(HelloWorld::onTouchEnded, this);
  touchListener-&gt;onTouchMoved = CC_CALLBACK_2(HelloWorld::onTouchMoved, this);
  touchListener-&gt;onTouchCancelled = CC_CALLBACK_2(HelloWorld::onTouchCancelled, this);
  
  _eventDispatcher-&gt;addEventListenerWithSceneGraphPriority(touchListener, this);
  
  return true;
  }
  
  bool HelloWorld::onTouchBegan(Touch* touch, Event* event)
  {
      auto target = event-&gt;getCurrentTarget();
  
      if (target is Card) target.openCard(); // not working
  
      return true;
  }
  </code></pre>