Dynamic ScrollView

Hey guys,

I am attempting to create a dynamic scrollView of sorts and am having a terrible time with positions and limits.

I am not try to resize the scrollView while the app is running.  My app is an eBook that has 2 “chunks of content” now, and we plan to do more in the future.

For that reason, I am trying to have my scrollView be given a dynamic width and a scrollWidth when the app launches depending on the number of “chunks of content” that are available. ( this way we can add new content without having to update the app, and the scrollView will expand with no issues ).

What I am trying to accomplish is pretty much exactly what Cut the Rope does in their “Box” selection page.

I think most of my problems are occuring from the setup of the width VS scrollWidth ratio.  Here is what I am currently doing:

--With this variable, I am trying to calculate the width that the scrollView should be able to scroll local scrollerWidth = ( 250 \* global.volumeCount ) + ((global.volumeCount - 1) \* 50) -- Create a ScrollView volumeScroller = widget.newScrollView { width = scrollerWidth, height = 360,     scrollWidth = 1000,     hideBackground = true, verticalScrollDisabled = true, listener = scrollListener, } volumeScroller.x = display.contentWidth volumeScroller.y = -380 volumeSelectGroup:insert(volumeScroller) volumeScroller:insert( volumePane1 ) volumeScroller:insert( volumePane2 ) volumeScroller:insert( dealPane ) --Here are buttons that will be in the scrollView dealPane = widget.newButton{ defaultFile = "images/gui/volumeAd.png", width = 250, height = 250, onEvent = menuFunctions.volumeButtonClicked, id = 0 } dealPane.x = 0 dealPane.y = 200 volumeSelectGroup:insert(dealPane) volumePane1 = widget.newButton{ defaultFile = "volume1/volumeScroll.png", width = 250, height = 250, onEvent = menuFunctions.volumeButtonClicked, id = 1 } volumePane1.x = 300 volumePane1.y = 200 volumeSelectGroup:insert(volumePane1) volumePane2 = widget.newButton{ defaultFile = "volume1/volumeScroll.png", width = 250, height = 250, onEvent = menuFunctions.volumeButtonClicked, id = 2 } volumePane2.x = 600 volumePane2.y = 200 volumeSelectGroup:insert(volumePane2)

Any help and thoughts would be greatly appreciated. Thanks!