issue with `FileReference.download()` in AS2
[This question comes from ruffle-rs/ruffle#15297.]
I have the following source for swfc from SWFTools:
.flash filename="frd.swf" background=white bbox=600x600 version=8
.frame 1
.action:
function download_file()
{
var listener = new Object();
var fileref = new FileReference();
fileref.addListener(listener);
fileref.download("http://example.com","debug-cancel.txt");
}
download_file();
.end
.end
I cannot make it work. I get errors if I replace new FileReference() with new flash.net.FileReference() (or if I prepend import flash.net.FileReference; to the function).
Am I missing something here or is it simply that swfc cannot handle FileReference.download() in AS2?
Many thanks for your help.
My guess is that FileReference.download() is not implemented in AS2.
@ousia FilReference.download() is implemented in AS2, I coded it for many projects. https://open-flash.github.io/mirrors/as2-language-reference/flash/net/FileReference.html
Sorry, @ROBERT-MCDOWELL, I know FileReference.download() is part of AS2.
I suspect that the AS2 code generated by swfc cannot handle FileReference.download().
I thought that the included sample was valid AS2 code, but I’m afraid it isn’t working.
Many thanks for your help.