Page 2 of 2

Re: Trying to figure this out

Posted: Thu Mar 17, 2011 4:41 pm
by bn
Hi Padley,

I modified the first stack I posted so that images in the horizontal scroller scroll into view after scrolling. That way you have one image centered at a time.
Should be generic enough for other/more pictures.


Kind regards
Bernd

Edit: I tested it on my iPhone G3 and the snapping to the image after scrolling was a little too slow.
To speed that up you can increase the stepsize in the repeat loop to 10 in the card script in the "findNearest" handler

Code: Select all

      repeat with i = tCurrentLoc  to tClose step 10 -- change stepsize
         set the hScroll of group "picGroup" to i
         wait 5 milliseconds with messages
      end repeat
   else
      repeat with i =  tCurrentLoc down to tClose step - 10 -- change stepsize
         set the hScroll of group "picGroup" to i
         wait 5 milliseconds with messages
      end repeat

Re: Trying to figure this out

Posted: Fri Mar 18, 2011 12:21 pm
by padley123
Wow thank you very much BN it makes much more sense now.

Re: Trying to figure this out

Posted: Thu Apr 07, 2011 7:27 pm
by JosepM
Hi,

I just download and play with the examples horzPicScroll and horzPicShow into the iPad.

I copied two times the horzPicShow group to test it but only the one that have the layer = 1 work.
Why?

Salut,
Josep

Re: Trying to figure this out

Posted: Thu Apr 07, 2011 8:36 pm
by bn
Hi Josep,
I copied two times the horzPicShow group to test it but only the one that have the layer = 1 work.
Why?
because the logic is all in the card script and on openCard triggers a handler "createUIViewScroll". This handler initializes ONE (1) instance of a scrolling area.

If you place 2 horzPicShow groups on the same card the opencard will grab the first "picGroup" group available and that is the one with the lowest layer.

Kind regards

Bernd

Re: Trying to figure this out

Posted: Thu Apr 07, 2011 9:39 pm
by JosepM
Hi,

horzPicScroll have the logic into the card, yes, but I testing the horzPicShow and in the card haven't any code, all the code is inside the group "picGroup".
In my case I have two groups, "picGroup" and "picGroup2".

Changing the layer value from one to other, produce that run one or other...

Salut,
Josep

Re: Trying to figure this out

Posted: Thu Apr 07, 2011 10:02 pm
by bn
Hi Josep,

how do you initialize the scrolling area in the groups ?

I suggest you change all references to picGroup and change them to picGroup2 in the second group. Of Course you would have to rename the group accordingly. (Not tested since I don't know exactly what you are doing)

Kind regards

Bernd