- Home /
Question by
chief1234 · Oct 25, 2010 at 06:27 PM ·
guieditordrag-and-drop
DragAndDrop class
Hi,
I'm trying to use this code from the DragAndDrop documentation, but it's giving me an "Invalid Cast Exception" error for the DragAndDrop.objectReferences line...
I don't understand what kind of object it needs...
Thanks in advance!
function restoreSelection(o : Object){
// Clear out drag data
DragAndDrop.PrepareStartDrag ();
// Set up what we want to drag
DragAndDrop.objectReferences = o;
// Start the actual drag
DragAndDrop.StartDrag ("bookmark");
}
Comment
Best Answer
Answer by lhk · Oct 25, 2010 at 06:58 PM
Try this c# code
DragAndDrop.objectReferences = new Object[1];
DragAndDrop.objectReferences[0]=o;
Or
DragAndDrop.objectReferences[0]=o;
I'm sorry but I can't test this code myself, because I'm currently not using my own PC.