imageSource Stored in Destination Stack
J. Landman Gay
jacque at hyperactivesw.com
Thu Jan 5 15:21:50 EST 2006
Kathy Jaqua wrote:
> Thanks Jacqueline,
>
> I have a field with about 350 ImageSources.
> I use the following format:
> set the clipboardData["image"] to image gImage --
> (this is the image the user picked)
> but on a Paste into the new stack I lose the image
> name.
That doesn't matter, because the imagesource references by ID.
> If I get the selection of an imageSource from the
> field and go to a new stack
> should I:
> 1. paste the original image and then hide it? Is it
> the same image as the imageSource since I have lost
> the image name on the paste.
You could do it that way, but the ID will change. The name doesn't
matter, but you'll need to get the ID of the last image after the paste
happens. Then use that number of build a new imagesource tag in the field.
>
> 2. then paste (at the mouse click) the Imagesource
> into the new field?
Yes, but it won't work until you change the ID that the imagesource is
using. It might be easier to just build a new imagesource tag using the
correct ID number and insert that into the htmltext before setting the
field to use the new text.
>
> What is the difference between 'copy img' and
> 'clipboardData["image"]'?
The "copy <object> to <location>" command bypasses the clipboard
entirely and duplicates the image directly to the new location. Current
clipboard contents are not disturbed. Setting the clipboardData does
alter the clipboard contents and requires you to paste the content in
order to get the image duplicated to the new location. You can use
either method. One advantage to the "copy to location" command is that
if the image that you are copying is already invisible, it will remain
invisible after it is duplicated, so the user won't see the image
flashing on and off as they would if you paste/hide it.
--
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
More information about the use-livecode
mailing list