scrollView:scrollToPosition() now not working in latest daily builds

This should not throw an error:
scrollView:scrollToPosition( -500, nil,500, scrollComplete )

or

scrollView:scrollToPosition( -500,0,500, scrollComplete )

Now throws strange error like this (in simulator)

?:0: attempt to index a number value
stack traceback:
[C]: ?
?: in function ‘scrollToPosition’
…ut\sprout2013\2013_new\scrolltopositiontest\main.lua:22: in function
‘main’

Full code of a test main.lua for examination (not my production code, but an example used to send a bug report).

function main()  
 print("testing basic scroll to position")  
 local widget = require "widget"  
 function scrollComplete()  
 ----print "scroll to brand complete"  
 end  
  
  
 local scrollView = widget.newScrollView{  
 width = 800,  
 height = 200,  
 scrollWidth = 800,  
 scrollHeight =0,  
 bgColor= {255, 255,255 ,255},  
 top=510,  
 left=110,  
 listener=scrollViewListener,  
 verticalScrollDisabled=true  
 }  
  
 scrollView:scrollToPosition( -500, nil,500, scrollComplete )  
end  
  
main()  

Any ideas when or why this stopped working. There have been some changes to the widgets lately that have been causing errors (I’m looking at you, scrollView.content.verticalScrollDisabled = true). Could this be another?
[import]uid: 110703 topic_id: 36717 reply_id: 336717[/import]

Fixed by looking at most recent docs (duh!).

The call HAS TO BE FOR MATTED LIKE THIS NOW!!!

scrollView:scrollToPosition  
 {  
 x = currentBrandScrollPosition,  
 y = 0,  
 time = 500,  
 onComplete = scrollTobrandComplete,  
 }  

Please take note that ALL of you older code that uses this widget will need to be changed. There might be other changes too, so of course, read the latest API docs. [import]uid: 110703 topic_id: 36717 reply_id: 145014[/import]

Fixed by looking at most recent docs (duh!).

The call HAS TO BE FOR MATTED LIKE THIS NOW!!!

scrollView:scrollToPosition  
 {  
 x = currentBrandScrollPosition,  
 y = 0,  
 time = 500,  
 onComplete = scrollTobrandComplete,  
 }  

Please take note that ALL of you older code that uses this widget will need to be changed. There might be other changes too, so of course, read the latest API docs. [import]uid: 110703 topic_id: 36717 reply_id: 145014[/import]

Fixed by looking at most recent docs (duh!).

The call HAS TO BE FOR MATTED LIKE THIS NOW!!!

scrollView:scrollToPosition  
 {  
 x = currentBrandScrollPosition,  
 y = 0,  
 time = 500,  
 onComplete = scrollTobrandComplete,  
 }  

Please take note that ALL of you older code that uses this widget will need to be changed. There might be other changes too, so of course, read the latest API docs. [import]uid: 110703 topic_id: 36717 reply_id: 145014[/import]

Fixed by looking at most recent docs (duh!).

The call HAS TO BE FOR MATTED LIKE THIS NOW!!!

scrollView:scrollToPosition  
 {  
 x = currentBrandScrollPosition,  
 y = 0,  
 time = 500,  
 onComplete = scrollTobrandComplete,  
 }  

Please take note that ALL of you older code that uses this widget will need to be changed. There might be other changes too, so of course, read the latest API docs. [import]uid: 110703 topic_id: 36717 reply_id: 145014[/import]

Why change the syntax? It does exactly the same job, so why screw up everyone’s code?

 

Nick, things like this were done to simplify both the usage and the internal code. Widget 2.0 isn’t widget 1.0, so I find the “screw up everyones code” comment unfair. There is a migration guide that explains all of these changes.

Why change the syntax? It does exactly the same job, so why screw up everyone’s code?

 

Nick, things like this were done to simplify both the usage and the internal code. Widget 2.0 isn’t widget 1.0, so I find the “screw up everyones code” comment unfair. There is a migration guide that explains all of these changes.

i cant seem to find a “migration guide” i see mention of it in several places…am i just missing something…any chance of an actual link??

http://docs.coronalabs.com/daily/api/library/widget/migration.html

:wink:

i cant seem to find a “migration guide” i see mention of it in several places…am i just missing something…any chance of an actual link??

http://docs.coronalabs.com/daily/api/library/widget/migration.html

:wink: