catching tap events from an image in a container

I have an image that I insert into a container.

Then I add a “tap” listener to the image.

Here is my code:

_group = display.newGroup();

_container = display.newContainer( 800, 400 )
_container:translate( 0, 0 );

cyborg = display.newImage( “cyborg.jpg” );
_container:insert( cyborg, true );
cyborg.x = -500;
cyborg:addEventListener( “tap”, onCyborgTap );

_container.y = -250;
_group:insert( _container );

The “onCyborgTap” function is never executed.

If I don’t add the image to the container, the function is executed as expected.

Please help :slight_smile:

you don’t show your “onCyborgTap” function - does it exist and is in scope at the time you add the listener??

or,… have you double-checked your coordinates?  unless your image is very large it wouldn’t be visible/tap-able at -500,-250.

you don’t show your “onCyborgTap” function - does it exist and is in scope at the time you add the listener??

or,… have you double-checked your coordinates?  unless your image is very large it wouldn’t be visible/tap-able at -500,-250.