问题
I am trying to call fileReference.browse from outside the flash SWF, i read some articles that said normally it's imposible due to Flash 10 security stuff.. so i was wondering isnt it posible to send a command from js to flash which will simulate a keypress inside the flash, which (this keypress) will trigger the fileReference.
Thank you in advance, Daniel!
回答1:
It's impossible (it would create quite a serious security risk). You can confirm this by checking any uploader module out there that uses Flash's FileReference... all of them use either a transparent flash overlay to register the click or the upload button itself is a customizable SWF (until recently gmail used a transparent overlay, now it uses native uploads I think).
来源:https://stackoverflow.com/questions/10323976/filereference-browse-from-js-simulate-keypress-in-flash-workaround