Button does not work when the image(scrollView) is under this button

Hi! Like many people, I started learning Korona from the popular lesson “Corona SDK App Creation: Part 1” on youTube (It describes how to create a simple application about recipes of pasta)

In the final scene, we have:
*Image and recipe pasta (.png), which supports scrollView
*Semi-transparent topBar at the top of the screen.
*BackButton over this TopBar.
I strictly followed the lesson, and has made only thematic changes and used Iphone4 view (author used another phone).

Everything works. And BackButton works too. But if the image(using scrollView) is situated under the BackButton, then click on the button is useless - you simply drag the image.

However, the author of the lesson use the same code and it works.

What could be wrong? I shuffled all the possible options. Even so place the picture over the BackButton and under the BackButton. Nothing helps. For a hour I was watching the code carefully, studied every line. Korona Simulator Output looks happy and say nothing (except “movemovemovemovemove…end” when i’m draging the picture =)
Here is the code of Lua file about me. (I changed recipes and dishes, to the members of my family. This is so cute, don’t you?))

[code]module (…, package.seeall)

function new ()
local familyGroup = display.newGroup ()

local scrollView = require (“scrollView”)
local util = require (“util”)
local topBoundary = display.screenOriginY
local bottomBoundary = display.screenOriginY
local scrollView = scrollView.new {top = topBoundary, bottom = bottomBoundary}

local anton = display.newImage (“graphics / anton.png”)

local topbar = display.newImage (“graphics / topbar.png”)
local back = display.newImage (“graphics / back_button.png”)
back.x = 50
back.y = 95
back.scene = “menu”
back: addEventListener (“touch”, changeScene)

scrollView: insert (anton)
familyGroup: insert (scrollView)
familyGroup: insert (topbar)
familyGroup: insert (back)[/code]
Thank you for your advices.
PS:
To freeze strictly the picture below the button - is not the solution.
PSS: Its for to help your imagination
[import]uid: 120280 topic_id: 21060 reply_id: 321060[/import]

Where`s your function called changeScene?

Take that and insert [lua]return true[/lua] at the end of your back button touch listener.
Cheers,
Rodrigo. [import]uid: 89165 topic_id: 21060 reply_id: 83217[/import]

In my previous post, I made a mistake and did not copy the whole code. Im sorry.Code ends with this:

[code]…
familyGroup:insert(topbar)
familyGroup:insert(back)

return familyGroup
end[/code]
My function called changeScene (if I understood you right) is in my main.lua

[code]function changeScene(e)
if (e.phase == “ended”) then
director:changeScene(e.target.scene)
end
end

local director = require(“director”)
local mainGroup = display.newGroup()

mainGroup:insert(director.directorView)
director:changeScene(“intro”)[/code]

There are a few identity lua files, and and I cant use back_button only in the file where I made ScrollView. (Frankly speaking, Back_button can be used if I drag image down ver very fast, and very very fasr click on the Back_button) => Picture(photo) “overlay” button or something like this.

[import]uid: 120280 topic_id: 21060 reply_id: 83228[/import]

@Samo, I think I understood you well and so you did too.

Thanks for posting the code about the “changeScene” function.

So taking exactly what you`ve posted above, see below:

[lua]function changeScene(e)
if (e.phase == “ended”) then
director:changeScene(e.target.scene)
end
return true <end[/lua]
After that see what happens.
Cheers,
Rodrigo. [import]uid: 89165 topic_id: 21060 reply_id: 83239[/import]

@RSCdev
In fact,I do not know any programming language, as well as English language too.I really do not fully understand previous time what should I do. I tried to insert a “return true” where it’s possible.
And I have three hundred times revised lesson on youtube and the author just did not use “return true”. My main.lua is copy of his. Im just learning and trying to understand how it works, not to make my own app. Sorry for your time.
Just do not want you to think that I’m lazy and just love to annoy people)

Your solution works. Thank you very much [import]uid: 120280 topic_id: 21060 reply_id: 83257[/import]

@Samo - NO WORRY mate! We`re all into the same boat! :slight_smile:

You`re welcome!

PS: I do not know what video youre whatching, BUT get your attention always to the Coronas VERSION that the developer in the video is running because many times the news corona builds does have different and newers APIs and so some get deprecated and sometimes we do not “know” it at the right time and so some strange “bugs” does “hurt” us. :]
Anything I can help, no problem - I`ll do.

Cheers,
Rodrigo. [import]uid: 89165 topic_id: 21060 reply_id: 83259[/import]

@@RSCdev

THANK YOU!!!

Man, you made my day! I have been looking for a solution to the same problem for months now. I gave up on it for while because i had much bigger problems to deal with but now it was becoming an urgent issue since it was one of the last bugs I had to deal with. Sure enough your solution worked PERFECTLY!

THANK YOU AGAIN!

Mo [import]uid: 49236 topic_id: 21060 reply_id: 94005[/import]

@lemsim , WOW, you made my day!

I`m glad that you got your problem solved!

By the way, you`re very welcome. :slight_smile:

Cheers,
Rodrigo. [import]uid: 89165 topic_id: 21060 reply_id: 94014[/import]