Page 1 of 1

Scrolling a group

Posted: Mon Oct 15, 2012 4:44 pm
by JosepM
Hi,

I'm lost about how deal with this.

I have a image, 2048x1536 pixels, not retina scale, only a big background. With this image I group some other images, so I have a group that I want scroll. With "grab me" command all is ok. I can scroll and "click" over the images inside the group, but when I apply a "scroll" object nothing work. Also I need a toolbar over the scroll region, so the user must actuate clicking the images inside the group and the toolbar.

I post a image for a best explantion.

The blue area is the image and the stars are the controls that from the group.

It's posible do that I need? Any experience?

Salut,
Josep M

Re: Scrolling a group

Posted: Tue Oct 16, 2012 12:11 am
by scotttyang
see the attached app call mapscroll.livecode. similar to what you are doing, except it's a map and has groups with buttons on it that when clicked gives the name of the country.

Re: Scrolling a group

Posted: Tue Oct 16, 2012 12:56 am
by JosepM
Hi Scotty,

Big thanks! :) just what I need.

In my code I assign the rect and the contentrect directly from the image properties, this is basically the difference, and the "grab me" :?

One question more. How drag a button inside the scroll group? With "grab me" only I move a little but don't work.
I need a "double tap" to create a object inside the map group and move it to a desired position. Any idea how do that?

Salut,
Josep M

Re: Scrolling a group

Posted: Tue Oct 16, 2012 1:14 am
by scotttyang
That's a dangerous question. Your asking to move a object in a moving object. I've never tried moving an object in a scroll group!

Re: Scrolling a group

Posted: Tue Oct 16, 2012 7:03 am
by JosepM
And scroll to a region? In your example, the user click into the toolbar to show europe, usa, asia... and the scrolling move to the x,y position into the scroller... :|

Re: Scrolling a group

Posted: Tue Oct 16, 2012 3:29 pm
by JosepM
Hi,

Autoanswer...

To scroll to any X,Y use and put at mainstack or card level where you create the scroller.

Code: Select all

on moveTo vS,hS
   iphoneControlSet sScrollerId, "vscroll", vS
   iphoneControlSet sScrollerId, "hscroll", hS
end moveTo

Re: Scrolling a group

Posted: Tue Oct 16, 2012 3:31 pm
by JosepM
Hi,

Now left the drag controls inside a scroller... any experience?

Salut,
Josep M

Re: Scrolling a group

Posted: Tue Oct 16, 2012 7:22 pm
by JosepM
Hi,

I try to positionate the scroller into a X,Y in the preOpenCard but nothing happen, nor OpenCard...

Code: Select all

on opencard
   if the environment is not "mobile" then
      exit opencard
   end if
   iphoneControlSet sScrollerId, "hscroll", 2126
   iphoneControlSet sScrollerId, "vscroll", 355
end opencard
But If I call this from a button, work. :(
What I'm doing wrong?

Salut,
Josep M