FileReference via ExternalInterface
I am creating a custom upload box like <input type="file"> by integrating Flash and JavaScript.
What happens is, when user clicks an HTML button or link, Flash should display browse for file dialog box (FileReference). For that, I am calling a function in ActionScript from a function in page's JavaScript using ExternalInterface.
But it doesn't work, the dialog is not displayed. i.e. The AS function is called but myFileReference.browse() returns False.
It works if called from AS function, i.e. click event of a Flash button. But when the same function is called from JavaScript integration, it fails.
Any solution? I've already tried setting the param "allowScriptAccess" to "always" but no avail.
I've attaching an example, please run it from some web server.
|