Using the FileReference class to recconnect?

Hello,

I would like to know if there is a way to recconnect my connection useing the file reference class. For instance when the user uploads the file to the remote server, and loses there connection. Is there a way in the class that I can recconnect useing the file reference class. Any suggestions would be helpful, although I’m considering of adding a function where it would reconnect in the file reference class. I have attached the fla and also paste the source.

Thank you!

Abe

Heres the source code:

import flash.net.FileReference;
var progressBar:MovieClip;
var reference:FileReference = new FileReference();
var referenceListener:Object = {};

var scriptLocation:String = ‘uploader.php’;
var progressBarHeight:Number = 10;
var progressBarY:Number = 50;
var progressBarColor:Number = 0x66ccff;

uploadButton_mc._visible = false;

reference.addListener(referenceListener);

referenceListener.onSelect = activateUploadButton;
referenceListener.onProgress = updateProgress;
referenceListener.onComplete = restart;

referenceListener.onHTTPError = handleError;
referenceListener.onIOError = handleError;
referenceListener.onSecurityError = handleError;
chooseButton_mc.onRelease = choose;
uploadButton_mc.onRelease = uploadCurrent;

function activateUploadButton():Void
{
display_txt.text = reference.name;
uploadButton_mc._visible = true;
}
function choose():Void
{
reference.browse([{description:‘All Files (.)’, extension:’.mov;.wmv’}]);
}
function handleError(errorName:String, detail:Object):Void
{
restart();
if (arguments.length === 2)
{
if (typeof detail === ‘number’)
{
display_txt.text = ‘HTTP Error #’+detail;
}
else
{
display_txt.text = 'Security Error: ‘+detail;
}
}
else
{
display_txt.text = ‘IO Error’;
}
}
function makeProgressBar(x:Number, y:Number):MovieClip
{
var bar:MovieClip = createEmptyMovieClip(‘progressBar_mc’, 0);
bar._visible = false;
bar.beginFill(progressBarColor);
bar.lineTo(Stage.width, 0);
bar.lineTo(Stage.width, progressBarHeight);
bar.lineTo(0, progressBarHeight);
bar.lineTo(0, 0);
bar.endFill();
bar._width = 0;
bar._visible = true;
bar._x = x;
bar._y = y;
return bar;
}
function restart():Void
{
removeMovieClip(progressBar);
display_txt.text = ‘’;
uploadButton_mc._visible = false;
chooseButton_mc._visible = true;
}
function updateProgress(fileReference:FileReference, bytesLoaded:Number, bytesTotal:Number):Void
{
display_txt.text = fileReference.name+’ - '+Math.ceil((bytesLoaded/bytesTotal)100)+’%’;
progressBar._width = Math.ceil(Stage.width
(bytesLoaded/bytesTotal));
}
function uploadCurrent():Void
{
chooseButton_mc._visible = false;
progressBar = makeProgressBar(0, progressBarY);
reference.upload(scriptLocation);
}

Abel Gudino