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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Important: Only Flash applications that are running in a browser — that is, using the browser<br />

plug-in or ActiveX control — can provide a dialog to prompt the user to enter a user name<br />

<strong>and</strong> password for authentication, <strong>and</strong> then only for downloads. For uploads that use the plugin<br />

or ActiveX control, or that upload <strong>and</strong> download using either the st<strong>and</strong>alone or external<br />

players, the file transfer fails.<br />

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

Parameters<br />

fileRef:File<strong>Reference</strong> - The File<strong>Reference</strong> object that initiated the operation.<br />

Example<br />

The following example traces a message when the onIOError event is triggered. For<br />

simplicity, none of the other event listeners are included in this example.<br />

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

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

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

trace("onIOError");<br />

}<br />

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

fileRef.addListener(listener);<br />

fileRef.download("http://www.adobe.com/NonExistentFile.pdf",<br />

"NonExistentFile.pdf");<br />

onOpen (File<strong>Reference</strong>.onOpen event listener)<br />

onOpen = function(fileRef:File<strong>Reference</strong>) {}<br />

Invoked when an upload or download operation starts.<br />

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

Parameters<br />

fileRef:File<strong>Reference</strong> - The File<strong>Reference</strong> object that initiated the operation.<br />

582 <strong>ActionScript</strong> classes

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

Saved successfully!

Ooh no, something went wrong!