dragDrop -- dragData("image")

J. Landman Gay jacque at hyperactivesw.com
Thu Jan 22 19:15:15 EST 2004


On 1/21/04 9:27 PM, Kathy Jaqua wrote:

> I can dragDrop -- dragData("text") to a target from a
> substack to a stack.
> 
> I would like to dragData["image"] from a substack or
> palette and dragdrop it on a card.
...
> Where do I put the following dragEnter and dragDrop
> script (Which of course after working 2 days dose not
> work either)?
> 
> on dragEnter
>   set the acceptDrop to true
> end dragEnter
> 
> on dragDrop
> create image the dragData["image"]  
> end dragDrop

Cards do not receive the dragDrop message. I solved this in one of my 
stacks by placing a huge transparent button underneath all other 
objects. That button did receive the message, but since it had no 
scripts it did not handle it. The message then passed through to the 
card script where it was handled with generic dragDrop and dragEnter 
handlers.

In your dragDrop handler above, the "create" line will create an image 
and try to assign it the name contained in the dragData -- which 
probably isn't a valid name. Instead you need to create the image and 
then assign its contents in two separate lines:

on dragDrop
  create image "myImage"
  set the imageData of image "myImage" to the dragData["image"]
end dragDrop

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



More information about the use-livecode mailing list