I’m probably missing something basic, but I’m stumped. I have created a scrollView in createScene, then when in enterScene I get the error
attempt to index global ‘scrollView’ (a nil value)
function scene:createScene( event ) local group = self.view local scrollView = widget.newScrollView { left = 0, top = 100, width = display.contentWidth, height = display.contentHeight - 320, scrollWidth = display.contentWidth, friction = 0.95, listener = displayScrollListener, horizontalScrollDisabled = true, isBounceEnabled = true, } group:insert( scrollView ) end
then
function scene:enterScene( event ) scrollView:scrollToPosition { x = 0, y = myGlobals.scrollToPosition, time = 800 } end
gets
attempt to index global ‘scrollView’ (a nil value)
how can I target/reference the scrollView that was created earlier when the scene was preloaded?
Thanks!