Drag-And-Drop Image Fun

dan johnson danjohnson at 37.com
Fri May 30 09:31:01 EDT 2003


Greetings,

I hope you will all tolerate the ignorance of a relatively new user.
I am using REV1.1.1 on Windows XP pro

I didn't read any of the threads about drag-and-drop connected with fields. 
However, after reading this thread on drag-and-drop for images (that has some 
bugs), it isn't exactly clear to me what the goal is. I can think of two 
possible cases with each using 2 possible "images": 1. simply dragging an image 
OR dragging some text (or other object) that represents an image and then 
dropping it into a "target", whereupon the actual image is displayed; 2. same as 
previous description except the Image (or its "reference") get COPIED and you 
drag the copy and drop it. For both cases, if a valid "targit" is not hit, then 
the start condtions are reset (i.e a dragged object gets returned to its start 
location.)

It seems to me that perhaps the routine that Rev already has for cloning by 
holding down the Ctrl key and dragging an object combined with the grab command 
could be modified for this. (Sorry, but I don't know how to "access" the scripts 
in the REV stacks, nor do I have an idea where to look for it even if I knew how 
to access it.)

Just by doing a couple of tests, I see that images can be grabbed and the 
intersect function used to determine if the target was reached. I put several 
empty image objects on a card, put 2 image objects with JPG files in them on the 
card, made a list (using a script) of all the image objects to use as valid 
targits, then grabbed an image and dropped it different places. If it 
intersected with a valid targit, the targit image object was resized to the size 
of the source image, then the imageData put into it. If a valid targit wasn't 
hit, then the source image was returned to its "home" location. This worked fine 
in a card script, so I could grab any of the images on the card. I was able to 
do it within the script limits of the unlicensed version.

So, while the new function in REV2 would be more convenient to script, it looks 
like you are limited to only PNG files. If I could figure out how to do a 
drag-and-drop of an image, then I'm sure any of you experienced programmers 
could write with ease a good script to do it and get around the PNG 
limitiation.

(Sorry if this is a little long winded. I don't make many posts, so I think my 
word count per month is still far below many other people's. LOL)

Dan J.


------------------------------------------------------------
http://Game.37.com/  <--- Free Games
http://newJoke.com/   <---  J O K E S  ! ! !
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.runrev.com/pipermail/use-livecode/attachments/20030530/4d6e7670/attachment.html>


More information about the use-livecode mailing list