Execute function on file drop

how exactly do i execute a function when a file is dropped on the window?

i’m trying to make this on windows / linux

The callback expects a string param which is the path of the file you dropped.

1 Like

That’s reminding me that I made some improvement in a PR long time ago. I need to ckeck what I can do to close this PR.

1 Like

i didnt find anything that helps there

I had to do the same a few weeks ago for a Windows application. This was the code I used:

Lib.current.stage.window.onDropFile.add( onFileDropped)

private function onFileDropped(filePath:String):Void
{
  // code to execute goes here
}
1 Like

I linked you to the exact API you needed above. @Tamar gave you the use-case example. I can verify this is exactly what you are looking for.

1 Like

thanks for the help
it worked