Drag and Drop in OpenFl

Hi everyone,

I’m hoping somebody can point me in the direction of where I can find information related to Drag and Drop functionality in OpenFL. I’ve done a bunch of Google searches, but have yielded little results. I’m hoping to see examples and source code of how it all comes together. Also, I would be interested to see Hit Tests or how I could detect where my image was dropped.

I’m coming from an AS3 background, but setting it up that way doesn’t seem to work. Comparing the different code has been useful for me in learning Haxe.

Thanks in advance for any help you can offer!

Hi!

Check out this tutorial:

https://www.openfl.org/learn/npm/tutorials/handling-mouse-events/

It’s meant for the NPM release of OpenFL, but it should work for the Haxelib release as well, just click on the tabs for the source code, and choose the Haxe versions :slight_smile:

3 Likes

Oh thank you, that was exactly what I needed. I see that my problem was in not knowing that the use of a Sprite adds interactivity to a bitmap. I had been trying to use a MovieClip, but it wasn’t working for me after attempting to interact directly with a bitmap didn’t do it. Didn’t occur to me to try a Sprite.

Lots of good info in that tutorial. Thanks again!

1 Like