I am trying to add touch event in layout elements. After touching it, I want to delete it.
var bird1 = new ccui.ImageView();
bird1.loadTexture(res.Bird);
bird1.setPosition(cc.p(size.width / 2, (size.height / 5) * 4));
bird1.setTouchEnabled(true);
bird1.addTouchEventListener(this.touchEvent, this);
layout.addChild(bird1);
this.addChild(layout);
touchEvent: function(sender, type)
{
switch (type)
{
case ccui.Widget.TOUCH_BEGAN:
cc.log("Touch Down");
type.setOpacity(0);
break;
}
},