Image touch event not working in scrollview

Hey guys, I got a problem. Everything in this works fine, except for the NextButton image. It shows up on the simulator, but when I press it, it does nothing, can anyone assist me?

display.setStatusBar( display.HiddenStatusBar ) local storyboard = require( "storyboard" ) local scene = storyboard.newScene() local NextObj -- Touch listener function for button object local function onBackTouch( self, event ) if event.phase == "ended" or event.phase == "cancelled" then -- go to page1.lua scene storyboard.gotoScene( "page1", "slideRight", 800 ) return true -- indicates successful touch end end function scene:createScene( event ) --import the scrolling classes local scrollView = require("scrollView") local util = require("util") local group = self.view local background = display.newRect(0, 0, display.contentWidth, display.contentHeight) background:setFillColor(140, 140, 140) -- Setup a scrollable content group local topBoundary = display.screenOriginY local bottomBoundary = display.screenOriginY local scrollView = scrollView.new{ top=topBoundary, bottom=bottomBoundary } local myText = display.newText("Wallpapers", 0, 0, native.systemFontBold, 16) myText:setTextColor(0, 0, 0) myText.x = math.floor(display.contentWidth\*0.5) myText.y = 48 scrollView:insert(myText) -- Back button NextObj = display.newImageRect("backButton.png",60,34) NextObj.x = 40 NextObj.y = 47 NextObj.isVisible = true -- add some text to the scrolling screen local lotsOfText = "To Download Wallpaper, Press and Hold Image and Save to Mobile Devices." local lotsOfTextObject = util.wrappedText( lotsOfText, 39, 14, native.systemFont, {0,0,0} ) local image1 = display.newImageRect("Jayceon\_One.png",333,217) local image2 = display.newImageRect("Jayceon\_Two.png",333,217) local image3 = display.newImageRect("Jayceon\_Three.png",333,217) local image4 = display.newImageRect("Jayceon\_Five.png",333,300) image1.x = 160 image1.y = 245 image2.x = 160 image2.y = 470 image3.x = 160 image3.y = 700 image4.x = 160 image4.y = 975 scrollView:insert(lotsOfTextObject) scrollView:insert( NextObj ) scrollView:insert(image1) scrollView:insert(image2) scrollView:insert(image3) scrollView:insert(image4) lotsOfTextObject.x = 24 lotsOfTextObject.y = math.floor(myText.y + myText.height) -- Important! Add a background to the scroll view for a proper hit area local scrollBackground = display.newRect(0, 0, display.contentWidth, scrollView.height+64) scrollBackground:setFillColor(255, 255, 255) scrollView:insert(1, scrollBackground) scrollView:addScrollBar() end -- Called immediately after scene has moved onscreen: function scene:enterScene( event ) local scrollView = self.view NextObj.touch = onBackTouch NextObj:addEventListener( "touch", NextObj ) end -- Called when scene is about to move offscreen: function scene:exitScene( event ) local group = self.view -- remove event listener from background --NextObj:removeEventListener( "touch", NextObj ) end -- If scene's view is removed, scene:destroyScene() will be called just prior to: function scene:destroyScene( event ) local group = self.view --NextObj:removeEventListener( "touch", NextObj ) -- INSERT code here (e.g. remove listeners, remove widgets, save state variables, etc.) end ----------------------------------------------------------------------------------------- -- END OF YOUR IMPLEMENTATION ----------------------------------------------------------------------------------------- -- "createScene" event is dispatched if scene's view does not exist scene:addEventListener( "createScene", scene ) -- "enterScene" event is dispatched whenever scene transition has finished scene:addEventListener( "enterScene", scene ) -- "exitScene" event is dispatched whenever before next scene's transition begins scene:addEventListener( "exitScene", scene ) -- "destroyScene" event is dispatched before view is unloaded, which can be -- automatically unloaded in low memory situations, or explicitly via a call to -- storyboard.purgeScene() or storyboard.removeScene(). scene:addEventListener( "destroyScene", scene ) ----------------------------------------------------------------------------------------- return scene

Yea, the scrollview has been inconsistent/broken for awhile. Scrollbar graphics don’t behave as documented and I cannot figure out a way to propogate events from buttons/images in a displayGroup in a scrollView to allow people to drag them intuitively (you should be able to drag from embedded elements, not just the exposed bits of the scrollview!).

(deleted)

Maybe you could try putting your scrollbackground before all your buttons… 

As I understand it, events should propogate, regardless of order, until they are handled. Right now there’s some issue with focus switching as an event is handled if it’s propogated from a button. I’ve recently converted all my buttons on the scrollviewback to newImage instances and it works as expected.

Yea, the scrollview has been inconsistent/broken for awhile. Scrollbar graphics don’t behave as documented and I cannot figure out a way to propogate events from buttons/images in a displayGroup in a scrollView to allow people to drag them intuitively (you should be able to drag from embedded elements, not just the exposed bits of the scrollview!).

(deleted)

Maybe you could try putting your scrollbackground before all your buttons… 

As I understand it, events should propogate, regardless of order, until they are handled. Right now there’s some issue with focus switching as an event is handled if it’s propogated from a button. I’ve recently converted all my buttons on the scrollviewback to newImage instances and it works as expected.