Peter Reid wrote:

>I'm trying to create objects in a vertical scrolling group using
>scripting.  I'm attempting to reproduce behaviour somewhat like a
>browser, so that a series of constant sized images layout in a set of
>rows and columns (a bit like laying playing cards).  Because there
>are a variable number of images, I need these to be created in a
>group with a vertical scroll bar, so the user can scroll down to
>those images off screen.
>
>What's working OK - I can create these images within a group and name
>them uniquely.  Also, I seem to be able to generate the right
>sequence of topLeft coordinates for positioning of each image in a
>grid pattern.
>
>What's NOT working - even though the topLeft coordinates look
>sensible, the images are being located all over the place!  Clearly,
>my topLeft coordinates are not correct in these circumstances, even
>though they look correct as if I were placing the images on a large
>static piece of paper.
>
>Can anyone explain how the coordinates work within a group that can scroll??

I've been doing something similar. (browser fever in the air)

You can have problems with setting locations in groups if you use the 
group coordinates as a reference. These will change as you create or 
move objects about.  I use a static reference for setting locations, 
for example a rectangle graphic which can be used as a frame for the 
visible portion of the group.

The basic procedure I use is something like this:

lock screen
put the rect of graphic "RefFrame" into tFrameRect
set the lockLocation of group "myGroup" to false ##perhaps not necessary
start editing background "myGroup" of this stack
##then create the objects and set the locs
##in relation to tFrameRect and /or other objects
stop editing background "myGroup" of this stack
##check if the group is bigger than tFrameRect
##if so, add scrollbars and set the rect of the group
##to tFrameRect
set the lockLocation of group "myGroup" to true

I was surprised how well this worked. In my case, I was parsing some 
xml data and placing it in fields of various sizes, locations, 
colors, etc. It didn't seem much slower than IE 5 or the latest 
Mozilla release rendering the same xml.

Cheers
Dave Cragg


Archives: http://www.mail-archive.com/[email protected]/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.

Reply via email to