how to disable all links when image is zoomed

Hi All,

In my app I have to make an image bigger to fit the whole screen when user taps it and the image goes back to original size when user taps the close button. Now everything is working fine except one thing. When image is zoomed all the links behind the image also work. Now I want all the content and links to be disabled when image is enlarged and make them work again when image goes back to original size. Now I can do this by manually disabling each item on the screen and re-enable them when image goes back to its original size. But this required a lot code. I need some short and simple way by which I can implement this.
Any help? :slight_smile: [import]uid: 126619 topic_id: 33107 reply_id: 333107[/import]

I do something similar as well with a zooming image.

The image is brought to front of course, then a transition.to (full screen size)…

But the image itself has a touch listener. Now, being in front, it receives the touch first, calls to shrink itself, and returns true.

The return true from the touch listener for my image prevents corona from passing the tap to objects behind it, hence no other buttons are passed the touch event.

Is your image touch listener returning true? [import]uid: 79933 topic_id: 33107 reply_id: 131474[/import]

Actually I have a cross button on full screen image to shrink it back. So when image is in full screen mode links behind the image work. As I have not set listener for image in full screen mode, perhaps thats why it is not preventing to pass the tap to other objects. So can you give me an idea that how to receive tap on full screen image and do nothing but prevent the tap from passing behind.
Thanks [import]uid: 126619 topic_id: 33107 reply_id: 131480[/import]

Any object, not just buttons, can have the listeners.

 myImage:addEventListener( "tap" , zoomedImageListener )  

In the listener, you can take no action at all, and just return true. (returning true tells the SDK that the input was handled by the object, false means it was not, and should be passed to objects below it visually).

Alternately, you can do something if you want, like make the image start shrinking.

[code]
local function zoomedImageListener(event)
print(" – zoomedImageListener(event) called.")

return true
end
[/code] [import]uid: 79933 topic_id: 33107 reply_id: 131487[/import]

I do something similar as well with a zooming image.

The image is brought to front of course, then a transition.to (full screen size)…

But the image itself has a touch listener. Now, being in front, it receives the touch first, calls to shrink itself, and returns true.

The return true from the touch listener for my image prevents corona from passing the tap to objects behind it, hence no other buttons are passed the touch event.

Is your image touch listener returning true? [import]uid: 79933 topic_id: 33107 reply_id: 131474[/import]

Actually I have a cross button on full screen image to shrink it back. So when image is in full screen mode links behind the image work. As I have not set listener for image in full screen mode, perhaps thats why it is not preventing to pass the tap to other objects. So can you give me an idea that how to receive tap on full screen image and do nothing but prevent the tap from passing behind.
Thanks [import]uid: 126619 topic_id: 33107 reply_id: 131480[/import]

Any object, not just buttons, can have the listeners.

 myImage:addEventListener( "tap" , zoomedImageListener )  

In the listener, you can take no action at all, and just return true. (returning true tells the SDK that the input was handled by the object, false means it was not, and should be passed to objects below it visually).

Alternately, you can do something if you want, like make the image start shrinking.

[code]
local function zoomedImageListener(event)
print(" – zoomedImageListener(event) called.")

return true
end
[/code] [import]uid: 79933 topic_id: 33107 reply_id: 131487[/import]