Flash 10 - read file from a drag and drop action?
I'm looking at how to read a file in flash 10 here:
http://www.thedesilva.com/2008/11/flash-10-file-reference/
is there a way to initiate the file read from a drag and drop? For example, the user drags and drops a text file onto my flash element in the browser - can I initiate the file read from that?
Thanks
You cannot do this operation in the browser. However it works in Adobe AIR -see this link http://www.mikechambers.com/blog/2007/11/07/air-example-native-drag-and-drop/
If you want to do this on the web you can use the new HTML5 function: window.FileReader
and trigger it from flash with an externalInterface call.
See http://code.google.com/p/html5uploader/ for an example of window.FileReader
精彩评论