Shy Images

Ken Ray kray at sonsothunder.com
Wed Aug 1 11:20:12 EDT 2007


On Wed, 01 Aug 2007 07:12:09 -0500, Len Morgan wrote:

> Any ideas?  Could I somehow duplicate the image I start with, make it 
> a top level image, and switch what Rev thinks it's dragging to that?

That's exactly what I was about to suggest... you'll need to make a 
copy, but not just inside the same group or you'll not be able to exit 
the group the original image was in. So you don't want to use "clone" 
(which would do just that), but instead do:

  copy the target to this card

which will make a copy and put it *outside* the group. After that, I'd 
enter your 'mouseMove' routine to do the dragging on the new image (the 
long id of which will be in "it"). Something like this (card script):

llocal sTarget

on mouseDown
  if word 1 of the name of the target is "image" then  -- or some other 
filter
    copy the target to this card
    put it into sTarget
  else
    pass mouseDown
  end if
end mouseDown

on mouseMove
  if sTarget is not empty then
    set the loc of sTarget to the mouseLoc
  end if
  pass mouseMove
end mouseMove

on mouseRelease
  delete sTarget  -- removes the copy you created
  put empty into sTarget
end mouseRelease

This is really simplistic, but you get the idea...



Ken Ray
Sons of Thunder Software, Inc.
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/



More information about the use-livecode mailing list