Hey everyone, could really use some help here. I tried to strip everything down so I could help arrive at the most simple issue.
When I run the code below the widget button works find on first launch. The scroll view takes focus when the button is move more than 10 pixels. After If drag on the button and move the scrollView the button can no longer be clicked.
If I remove the system.activate(“multitouch”) then everything works fine.
Any thoughts?
local widget = require( "widget" ) system.activate("multitouch") scrollView = widget.newScrollView( { top = 0, left = 0, width = display.contentWidth, height = display.contentHeight, scrollWidth = 300, scrollHeight = 800, hideBackground = true, hideScrollBar = true , --listener = scrollListener } ) local function handleButtonEvent1234( event ) local phase = event.phase if ( phase == "moved" ) then local dy = math.abs( ( event.y - event.yStart ) ) -- If the touch on the button has moved more than 10 pixels, -- pass focus back to the scroll view so it can continue scrolling if ( dy \> 10 ) then print("#########") scrollView:takeFocus( event ) button1:dispatchEvent( { name="touch", target=button1, phase="ended" } ) end elseif ( phase == "ended" ) then print("ended") end return true end button1 = widget.newButton { left = 10, top = 300, id = "button1", label = "Default", onEvent = handleButtonEvent1234 } scrollView:insert( button1 ) button1.x = display.contentCenterX button1.y = display.contentCenterY