DATAGRID dgDragImageIndex problem

Trevor DeVore lists at mangomultimedia.com
Tue Jul 20 12:28:06 EDT 2010


On Jul 20, 2010, at 12:16 PM, JosepM wrote:

> Yes, this is that I do, but the image is empty...
>
> The script:
>
> on dragStart
>
>   put the dgIndex of the dgDataControl of the target into theIndex
>
>   --set the dgDragImageIndex of me to theIndex
>   set the dgDragImageIndex of me to the id of the image  
> "dgDragImage" of me

DO NOT set the dgDragImageIndex to the id of the image. It is an index  
value. Set it to an index.

Again, you should start by checking the id of the image and comparing  
it to the dragImage. Insert this code after you assign the  
dgDragImageIndex:

put the id of the image "dgDragImage" of me & cr & the dragImage

If the values are the same then the dragImage is being assigned  
properly. Next confirm that the image has the data you expect.

Replace the code that outputs the id of the image with code that  
copies the image data to the clipboard:

set the clipboardData["image"] to the text of image "dgDragImage" of me

Paste the clipboard image somewhere where you can see it. Is it your  
row? If so then the data grid code is doing what it is supposed to.

If both of the above tests pass then you need to track down the image  
in another stack that has the same id as the dgDragImage of your data  
grid. Start searching for an image with the same id in any open  
stacks. Once you find it let us know and we can figure out how the  
engine is searching for the image to use and determine how to fix your  
problem.

Regards,

-- 
Trevor DeVore
Blue Mango Learning Systems
www.bluemangolearning.com    -    www.screensteps.com



More information about the use-livecode mailing list