![MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference Download Page 566](http://html.mh-extra.com/html/macromedia/flash-8-actionscript-2-0-language/flash-8-actionscript-2-0-language_reference_687537566.webp)
566
ActionScript classes
When the file has successfully downloaded, the properties of the FileReference object are
populated with the properties of the local file and the
onComplete
listener is invoked.
Only one
browse()
or
download()
session can be performed at a time (because only one
dialog box can be displayed at a time).
This method supports downloading of any file type, with either HTTP or HTTPS. You can
also send data to the server with the
download()
call by appending parameters to the URL,
for the server script to parse.
When using this method, consider the Flash Player security model:
■
Not allowed if the calling SWF file is in an untrusted local sandbox.
■
The default is to deny access between sandboxes. A website can enable access to a resource
by adding a cross-domain policy file.
For more information, see the following:
■
Chapter 17, "Understanding Security," in
Learning ActionScript 2.0 in Flash
■
The Flash Player 8 Security white paper at http://www.macromedia.com/go/fp8_security
■
The Flash Player 8 Security-Related API white paper at http://www.macromedia.com/go/
fp8_security_apis
Availability:
ActionScript 1.0; Flash Player 8
Parameters
url
:String
- The URL of the file to download to the local computer. You can send data to
the server with the
download()
call by appending parameters to the URL, for the server script
to parse. For example:
http://www.myserver.com/picture.jpg?userID=jdoe
On some browsers, URL strings are limited in length. Lengths greater than 256 characters
may fail on some browsers or servers.
defaultFileName
:String
[optional] - The default filename displayed in the dialog box, for
the file to be downloaded. This string cannot contain the following characters: / \ : * ? " < > |
%
If you omit this parameter, the filename of the remote URL is parsed out and used as the
default.
NO
TE
If your server requires user authentication, only SWF files that are running in a browser—
that is, using the browser plug-in or ActiveX control—can provide a dialog box to prompt
the user for a user name and password for authentication, and only for downloads. For
uploads using the plug-in or ActiveX control, and for uploads and downloads using the
stand-alone or external player, the file transfer fails.
Summary of Contents for FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Page 1: ...ActionScript 2 0 Language Reference ...
Page 1352: ...1352 ActionScript classes ...