Need Help Please - Flash/ASP.net File Upload tool

Source Files - http://www.jmanproductions.com/Source.zip

Good afternoon,
I’m trying to recreate a Flash/ASP.net File Upload tool that I saw here:
http://www.codeproject.com/aspnet/FlashUpload.asp
This version was done with Flash 8, so I wanted to recreate it using Flash CS3 and AS3.[URL=“http://www.jmanproductions.com/Default.aspx”]

So what’s my problem? Well The version above uses parameters sent to the flash player that the flash player uses for the upload method. Well I’m having trouble pinpointing my problem with the following code in bold. When I test it in Visual Studio nothing happens I can’t seem to figure out how to trace the value of the parameters, which are also below the code. so if anyone could point me in the right direction, or download the source, and help me out, I would much appreciate it.

Thanks!

Actionscript:

package {

import flash.display.MovieClip;
import fl.controls.Button;
import fl.controls.ProgressBar;
import fl.controls.TextArea;
import fl.controls.UIScrollBar;
import fl.controls.Label;
import flash.net.FileReference;
import flash.net.FileReferenceList;
import flash.net.FileFilter;
import flash.net.URLRequest;
import flash.events.*;

public class Upload extends MovieClip {

    private var _browseBtn:Button;
    private var _uploadBtn:Button;
    private var _statusText:TextArea;
    private var _statusBar:ProgressBar;
    private var _statusLabel:Label;
    private var _statusLabel2:Label;
    private var _statusLabel3:Label;
    private var _fileRefList:FileReferenceList=new FileReferenceList;
    private var _uploadedBytes:Number=0;
    private var _uploadedBytes2:Array;
    private var _totalBytes:Number=0;
    private var _totalFiles:Number=0;
    private var _filesCompleted:Number=0;
   ** private var _uploadPage:URLRequest = new URLRequest(root.loaderInfo.parameters.uploadPage);**

    public function Upload() {
        init();
    }
    private function init():void {
        createTextArea();
        createProgressBar();
        createButtons();
        createLabels();
        configureListeners(_fileRefList);
        _browseBtn.addEventListener(MouseEvent.CLICK,browseFiles);
        _uploadBtn.addEventListener(MouseEvent.CLICK,uploadFiles);
    }
    //Init Functions
    private function createTextArea():void {
        _statusText=new TextArea();
        _statusText.text= ""
        _statusText.move(5,5);
        _statusText.setSize(200,60);
        addChild(_statusText);
    }
    private function createProgressBar():void {
        _statusBar=new ProgressBar  ;
        _statusBar.move(220,40);
        _statusBar.visible = false;
        addChild(_statusBar);
    }
    private function createButtons():void {
        _browseBtn=new Button  ;
        _browseBtn.move(220,5);
        _browseBtn.width=60;
        _browseBtn.label="Browse";
        addChild(_browseBtn);

        _uploadBtn=new Button  ;
        _uploadBtn.move(310,5);
        _uploadBtn.width=60;
        _uploadBtn.label="Upload";
        _uploadBtn.enabled=false;
        addChild(_uploadBtn);
    }
    private function createLabels():void {
        _statusLabel=new Label  ;
        _statusLabel.move(220,50);
        _statusLabel.text="";
        addChild(_statusLabel);

        _statusLabel2=new Label  ;
        _statusLabel2.move(280,50);
        _statusLabel2.text="";
        addChild(_statusLabel2);

        _statusLabel3=new Label  ;
        _statusLabel3.move(300,50);
        _statusLabel3.text="";
        addChild(_statusLabel3);
    }
    private function configureListeners(dispatcher:IEventDispatcher):void {
        dispatcher.addEventListener(Event.SELECT,selectHandler);
        dispatcher.addEventListener(Event.CANCEL,cancelHandler);
        dispatcher.addEventListener(Event.OPEN,openHandler);
        dispatcher.addEventListener(ProgressEvent.PROGRESS,progressHandler);
        dispatcher.addEventListener(Event.COMPLETE,completeHandler);
        dispatcher.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
        dispatcher.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
    }
    //Button Handlers
    private function browseFiles(event:Event):void {
        _fileRefList.browse();
    }
    private function uploadFiles(event:Event):void {
        var list:Array=_fileRefList.fileList;
        var fileRef:FileReference;
        if (_uploadBtn.label == "Upload") {
            _browseBtn.enabled=false;
            _uploadBtn.label="Cancel";
            _statusText.text ="Starting Upload:" + '

';
_statusText.verticalScrollPosition=_statusText.maxVerticalScrollPosition;
_totalFiles=list.length;
_filesCompleted=0;
_uploadedBytes=0;
_uploadedBytes2=[];
_statusLabel2.text=“of”;
for (var i:Number=0; i < list.length; i++) {
fileRef=list*;
_statusText.text+= “Attempting to upload " + fileRef.name + ’
';
_statusText.verticalScrollPosition=_statusText.maxVerticalScrollPosition;
_uploadedBytes2[fileRef.name]=0;
fileRef.upload(_uploadPage);
}
} else {
_statusLabel.text=”";
_statusLabel2.text="";
_statusLabel3.text="";
_statusText.text+= “Upload Cancelled.” + ’
';
_statusText.verticalScrollPosition=_statusText.maxVerticalScrollPosition;
for (var j:Number=0; j < list.length; j++) {
fileRef=list[j];
fileRef.cancel();
}
_uploadBtn.label=“Upload”;
_browseBtn.enabled=true;
}
}
//Event Handlers
private function selectHandler(event:Event):void {
_uploadBtn.enabled = true;
_statusBar.visible = true;
_statusText.text = "Files selected to upload:
";
_statusText.verticalScrollPosition=_statusText.maxVerticalScrollPosition;
var list:Array=_fileRefList.fileList;
var fileRef:FileReference;
_totalBytes=0;
for (var i:int=0; i < list.length; i++) {
fileRef=list*;
_totalBytes+= fileRef.size;
_statusText.text+= fileRef.name + ’
';
_statusText.verticalScrollPosition=_statusText.maxVerticalScrollPosition;
}
}
private function cancelHandler(event:Event):void {
_uploadBtn.enabled=false;
_statusText.text="No files selected.
";
_statusText.verticalScrollPosition=_statusText.maxVerticalScrollPosition;
}
private function openHandler(event:Event):void {
_statusText.text+= "Uploading " + event.target.name + " please wait…
";
_statusText.verticalScrollPosition=_statusText.maxVerticalScrollPosition;
}
private function progressHandler(event:ProgressEvent, bytesLoaded:Number, bytesTotal:Number):void {
_statusBar.mode=“manual”;
var temp:Number= bytesLoaded - _uploadedBytes2[event.target.name];
_uploadedBytes2[event.target.name]= bytesLoaded;
_uploadedBytes+= temp;
_statusBar.setProgress(_uploadedBytes,_totalBytes);
_statusLabel.text=GetSizeType(_uploadedBytes);
_statusLabel3.text=GetSizeType(_totalBytes);
}
private function completeHandler(event:Event):void {
_statusText.text += event.target.name + " uploaded.
";
_statusText.verticalScrollPosition=_statusText.maxVerticalScrollPosition;
_filesCompleted ++;
_statusText.text += _filesCompleted + " of " + _totalFiles + " files completed.
";
_statusText.verticalScrollPosition=_statusText.maxVerticalScrollPosition;
/if (_filesCompleted == _totalFiles) {
FinishedUpload();
}
/
}
private function FinishedUpload():void {
_uploadBtn.enabled = false;
_uploadBtn.label = “Upload”;
_browseBtn.enabled = true;
}
//Error Handlers
private function ioErrorHandler(event:IOErrorEvent):void {
_statusText.text += "There was an IO error uploading " + event.target.name + "
";
_statusText.verticalScrollPosition=_statusText.maxVerticalScrollPosition;
}
private function securityErrorHandler(event:SecurityErrorEvent, errorString:String):void {
_statusText.text += "There was a security errors acessing " + event.target.name + " errorString: " + errorString;
_statusText.verticalScrollPosition=_statusText.maxVerticalScrollPosition;
}
//Utility Functions

    // Converts bytes into more redable values.
    function GetSizeType(size:Number) {
        if (size &lt; 1024) {
            return int(size * 100) / 100 + " bytes";
        }
        if (size &lt; 1048576) {
            return int(size / 1024 * 100) / 100 + "KB";
        }
        if (size &lt; 1073741824) {
            return int(size / 1048576 * 100) / 100 + "MB";
        }
        return int(size / 1073741824 * 100) / 100 + "GB";
    }
}

}

**Aspx Code:
**<%@ Page Language=“C#” AutoEventWireup=“true” CodeFile=“Default.aspx.cs” Inherits="_Default" %>

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>

<html xmlns=“http://www.w3.org/1999/xhtml” >
<head runat=“server”>
<title>Flash Upload</title>
</head>
<body>
<form id=“form1” runat=“server” enctype=“multipart/form-data” method=“POST”>
<div>
<%–

    Adding the flash uploader to the page.  &lt;param name="wmode" value="transparent"&gt; makes
    the movie transparent so any page styling can shine through.
    FlashVars is set to pass in the upload page and a javascript function if desired.
    The javascript function fires when the upload is completed.  This allows us to 
    call a codebehind function to refresh a gridView or anything else.
    A link button is used to perform this function.  The javascript is added in the pageLoad 
    in the code behin.
    --%&gt;
    &lt;object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"
     width="380" height="70" id="fileUpload" align="middle"&gt;
        &lt;param name="allowScriptAccess" value="sameDomain" /&gt;
        &lt;param name="movie" value="upload.swf" /&gt;
        &lt;param name="quality" value="high" /&gt;
        &lt;param name="wmode" value="transparent"&gt;
        **&lt;param name=FlashVars value='uploadPage=Upload.axd&lt;%=GetFlashVars()%&gt;&completeFunction=UploadComplete()'&gt;**
        &lt;embed src="upload.swf"
         **FlashVars='uploadPage=Upload.axd&lt;%=GetFlashVars()%&gt;&completeFunction=UploadComplete()'**
         quality="high" wmode="transparent" width="380" height="70" 
         name="fileUpload" align="middle" allowScriptAccess="sameDomain" 
         type="application/x-shockwave-flash" 
         pluginspage="http://www.macromedia.com/go/getflashplayer" /&gt;
    &lt;/object&gt;
    &lt;%--This link button is here so we can call the LinkButton1_Click event from javascript.
        Make the text empty so the link doesn't show up on the page.--%&gt;
    &lt;asp:LinkButton ID="LinkButton1" runat="server" OnClick="LinkButton1_Click"&gt;&lt;/asp:LinkButton&gt;
&lt;/div&gt;
    
&lt;/form&gt;

</body>
</html>