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.

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

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

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

if(!file.upload("http://www.yourdomain.com/<br />

yourUploadH<strong>and</strong>lerScript.cfm")) {<br />

trace("Upload dialog failed to open.");<br />

}<br />

}<br />

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

trace("onCancel");<br />

}<br />

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

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

}<br />

listener.onProgress = function(file:File<strong>Reference</strong>, bytesLoaded:Number,<br />

bytesTotal:Number):Void {<br />

trace("onProgress with bytesLoaded: " + bytesLoaded + " bytesTotal: " +<br />

bytesTotal);<br />

}<br />

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

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

}<br />

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

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

}<br />

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

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

}<br />

listener.onSecurityError = function(file:File<strong>Reference</strong>,<br />

errorString:String):Void {<br />

trace("onSecurityError: " + file.name + " errorString: " + errorString);<br />

}<br />

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

fileRef.addListener(listener);<br />

fileRef.browse();<br />

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

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

Saved successfully!

Ooh no, something went wrong!