Dragging files to cards

Visuals, audio, animation. Blended, not stirred. If LiveCode is part of your rich media production toolbox, this is the forum for you.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
rrBUSS9EE
Posts: 98
Joined: Wed May 02, 2012 3:46 pm

Dragging files to cards

Post by rrBUSS9EE » Wed May 02, 2012 6:57 pm

Hi… What do I need to do to accept a drop on a card or image object? Currently I am seeing the "crossed out circle" on any areas other than fields.

Thanks.

Klaus
Posts: 14189
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Dragging files to cards

Post by Klaus » Wed May 02, 2012 7:29 pm

Hi,

yes, Drag'n'Drop of text (to fields) does work out of the box wihtout any scripting.
Everything elsre needs to be scripted.

What exactly do you want to do?
What object(s) need to acceopt the DROPping?
Put the fielnames into a field? Set filename of images/pkayers?
Need to know this to give you a working example for your needs :D

Ah, and welcome to the forum!


Best

Klaus

P.S.
Please check these stacks, really great learning resources:
http://www.runrev.com/developers/lesson ... nferences/

rrBUSS9EE
Posts: 98
Joined: Wed May 02, 2012 3:46 pm

Re: Dragging files to cards

Post by rrBUSS9EE » Wed May 02, 2012 7:39 pm

Thanks Klaus!

I have a number of things I want to do, but why don't we start with just one as I am guessing I'll figure out the rest when I know what to do for this one.

I want to drag a file from the Finder to a card. On drop, I'd like to verify it is an image and if so, create a new image object and set it to the dropped image file.

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: Dragging files to cards

Post by mwieder » Wed May 02, 2012 8:02 pm

Welcome to the forum. You may find this useful:

http://lessons.runrev.com/s/lessons/m/4 ... t-a-primer

rrBUSS9EE
Posts: 98
Joined: Wed May 02, 2012 3:46 pm

Re: Dragging files to cards

Post by rrBUSS9EE » Wed May 02, 2012 8:19 pm

mwieder wrote:Welcome to the forum. You may find this useful:
What I get from this is that the destination requires a dragEnter handler. I have put one in the card script. The message is not sent when I drag a file from the Finder to the card. It is sent to a field on the card if the mouse is over that.

I am looking to drop the file on the card (and not a cd object).

Klaus
Posts: 14189
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Dragging files to cards

Post by Klaus » Wed May 02, 2012 8:28 pm

Hi,

a stack will tell more than thousand words :D
It also shows a workaround for the fact that "naked" cards do not accept DROPping.


Best

Klaus
Attachments
drag_and_drop1.rev.zip
(1.81 KiB) Downloaded 424 times

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: Dragging files to cards

Post by mwieder » Wed May 02, 2012 8:31 pm

ROTFL. I did something similar, importing an image, sizing it to the stack size, and setting its blendlevel to 100. Same effect.

rrBUSS9EE
Posts: 98
Joined: Wed May 02, 2012 3:46 pm

Re: Dragging files to cards

Post by rrBUSS9EE » Wed May 02, 2012 8:49 pm

Thank you both. No card level drops being allowed was indeed the issue.

Post Reply