03.05.2013 Views

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

creator (File<strong>Reference</strong>.creator property)<br />

public creator : String [read-only]<br />

The Macintosh creator type of the file. In Windows, this property is null. If the<br />

File<strong>Reference</strong> object has not been populated, a call to get the value of this property returns<br />

null.<br />

Availability: <strong>ActionScript</strong> 1.0; Flash Player 8<br />

Example<br />

The following example retrieves the Macintosh creator type of a file selected by the user.<br />

import flash.net.File<strong>Reference</strong>;<br />

var listener:Object = new Object();<br />

listener.onSelect = function(file:File<strong>Reference</strong>):Void {<br />

trace("creator: " + file.creator);<br />

}<br />

var fileRef:File<strong>Reference</strong> = new File<strong>Reference</strong>();<br />

fileRef.addListener(listener);<br />

fileRef.browse();<br />

See also<br />

browse (File<strong>Reference</strong>.browse method)<br />

download (File<strong>Reference</strong>.download method)<br />

public download(url:String, [defaultFileName:String]) : Boolean<br />

Displays a dialog box in which the user can download a file from a remote server. Although<br />

Flash Player has no restriction on the size of files you can upload or download, the player<br />

officially supports uploads or downloads of up to 100 MB.<br />

This method first opens an operating system dialog box that asks the user to enter a filename<br />

<strong>and</strong> select a location on the local computer to save the file. When the user selects a location<br />

<strong>and</strong> confirms the download operation (for example, by clicking Save), the download from the<br />

remote server begins. Listeners receive events to indicate the progress, success, or failure of the<br />

download. To ascertain the status of the dialog box <strong>and</strong> the download operation after calling<br />

download(), your <strong>ActionScript</strong> code must listen for events by using event listeners such as<br />

onCancel, onOpen, onProgress, <strong>and</strong> onComplete.<br />

File<strong>Reference</strong> (flash.net.File<strong>Reference</strong>) 573

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!