File reference class!

To whom this may concern,

I have a bit of a problem with the file reference class, to remove the visibility when my upload fully completely is done uploading. I have attached my files to this thread, and I’ve also pasted my code as well.

thanks!

abe:rocker:

import flash.net.FileReference;

var progressBar:MovieClip;
var eventHandler:Object = new Object();
var reference:FileReference = new FileReference();
var referenceListener:Object = {};

System.security.allowDomain(“dentsuinteractive.com”);

var url:String = ‘http://www.dentsuinteractive.com/clients/chandon/uploader/uploader.php’;

uploadButton_mc._visible = false;
progressBar_mc._visible = false;

reference.addListener(referenceListener);

chooseButton_mc.onRelease = choose;

referenceListener.onSelect = function(file:FileReference) {
trace(“Size: " + file.size+” Bytes");
trace("File name: " + file.name);
trace("Location: " + url);
reference.upload(url);
display_txt.text = file.name;
progressBar_mc._visible = true;
};

function choose(file:FileReference) {
reference.browse([{description:‘All Files (.)’, extension:’.’}]);
}

referenceListener.onHTTPError = function(file:FileReference) {
trace("onHTTPError: "+file.name);
};

referenceListener.onIOError = function(file:FileReference) {
trace("onIOError: "+file.name);
};

referenceListener.onSecurityError = function(file:FileReference, errorString:String) {
trace("onSecurityError: “+file.name+” errorString: "+errorString);
};

referenceListener.onComplete = function(file:FileReference) {
trace(“Complete”);
complete_txt.text = + " Complete: " + Math.round(bytesLoaded/bytesTotal100)+"%";
//trace(">> httpStatus: " + httpStatus);
display_txt.text = ‘’;
progressBar_mc._visible = false;
uploadButton_mc._visible = false;
chooseButton_mc._visible = true;
};
referenceListener.onProgress = function(file:FileReference, bytesLoaded:Number, bytesTotal:Number) {
trace("onProgress: “+file.name+” with bytesLoaded: “+bytesLoaded+” bytesTotal: "+bytesTotal);
progressBar_mc._xscale = Math.round(bytesLoaded/bytesTotal
100);
display_txt.text = file.name+" “+Math.round(bytesLoaded/bytesTotal*100)+”%";
};