OK I added those lines, plus I put the " elseif ( event.phase == “ended” ) then " back in.
When I tap the “Menu” link, this is the console output. There’s a began phase but no ended phase:
{
“id”:"<type ‘userdata’ is not supported by JSON.>",
“name”:“touch”,
“phase”:“began”,
“target”:{
“x”:113.83999633789,
“y”:56,
“_proxy”:"<type ‘userdata’ is not supported by JSON.>",
“_functionListeners”:{
“touch”:["<type ‘function’ is not supported by JSON.>"]
},
“removeSelf”:"<type ‘function’ is not supported by JSON.>",
“_cachedRemoveSelf”:"<type ‘function’ is not supported by JSON.>",
“_class”:{
“removeEventListener”:"<type ‘function’ is not supported by JSON.>",
“addEventListener”:"<type ‘function’ is not supported by JSON.>",
“__index”:"<reference cycle>"
}
},
“time”:613244.618,
“x”:125.87256622314,
“xStart”:125.87256622314,
“y”:61.869567871094,
“yStart”:61.869567871094
}
Here’s the function that contains the scrollView:
showAllScores = function() local function scrollListener( event ) [a bunch of print statements] return true end -- function mainData.scrollView = widget.newScrollView( { top = 0, left = 0, width = display.contentWidth, height = display.contentHeight, horizontalScrollDisabled = true, hideScrollBar = false, listener = scrollListener, }) local menuButton = display.newText ("menu", [...] local menuButtonBG = display.newRect(...) menuButtonBG:toBack()
menuButtonBG:addEventListener("touch",backToMenuFromScoresListener) for i=1,n do ...[create a bunch of display.newtext objects to display scores, then insert them in scrollView:] mainData.scrollView:insert(arrayToHoldScores[i].questionType) mainData.scrollView:insert(arrayToHoldScores[i].questions\_answered) mainData.scrollView:insert(arrayToHoldScores[i].correct) mainData.scrollView:insert(arrayToHoldScores[i].average) end -- for loop -- insert other display objecct in scrollview, including the menuButtonBG which has the listener: ... mainData.scrollView:insert(... ... mainData.scrollView:insert(menuButtonBG) -- menuBUttonBG has the listener attached that is supposed to go back to the menu