PDA

View Full Version : Important tipbit on onDrag, ondrop and dragdata.



drahkar
May 17th, 2011, 13:42
I was having issues when passing information from the onDrag for the starting element to the onDrop for the receiving element when using multiple slots on the dragdata object. This manifested as the onDrop not always starting over at slot 1 when a new dragdata object was created when data was dropped on it. I'm not sure what the cause of this issue is specifically, but the workaround I've found that seems to hold up is to start your ondrop with a draginfo.setSlot(1). That seems to work without any issues.

(And for whatever reason, draginfo.reset() does not address this issue. That was the first thing I tried.)

Moon Wizard
May 17th, 2011, 19:39
I've found that to be the case as well. When using multi-slot dragdata objects to pass information, I have to specifically set the slot each time I access the data to make sure that I'm pointing at the right data.

Regards,
JPG