Keeping relationships during a drag event.

J. Landman Gay jacque at hyperactivesw.com
Tue Dec 28 16:01:53 EST 2004


On 12/28/04 12:08 PM, Glen Bojsza wrote:

> The basic description of what I am working to achieve is the following.
> 
> I have 2 images (car1 and car2) that are connected by a line.
> 
> When the user drags car1 to a different position on the card the
> line's points are updated and to the user it appears that the images
> are still connected (the idea is a "sticky" line.
> 
> What I am trying to figure out is that  I want a field  to be placed
> at the center on the line and it needs to maintain that relationship
> with the line whenever  the image locations are changed.
> 
> The problem is that as the user drags an image around the line and
> it's associated field need to move / update smoothly.
> 
> I am looking at grouping the line and field verses taking the points
> of the line and recalculating the new location of the field.
> 
> I was hoping someone would have some experience in this area.

One of the examples in the old MetaCard "Examples" stack did almost 
exactly what you describe. It was so similar, you may be able to simply 
grab the script and re-use it.

You can still download the old MetaCard files at 
<ftp://ftp.metacard.com>. It probably doesn't matter which version you 
grab, as the engine there is very old and restricted. However, once you 
decompress the files, open the mchelp stack and look for the Examples 
stack. You'll find the script and a working mockup in there on card 9.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com


More information about the use-livecode mailing list