Need Help Understanding Some ActionScript

I’m quite a bit over my head, but I’ve been assigned the task of completing this Flash application. The original designer is now off the job and unavailable. Specifically, I need to get a Flash form that already contains ActionScript (2, I think) to send email. My knowledge of Flash is modest, and my knowledge of ActionScript is even weaker. That said, here goes.

It’s my understanding that the following ActionScript is sending 4 variables – “name”, “email”, “company”, and “msg” – to sendmail.php upon release of a button called “btn_send”. Three basic questions for now:[LIST=1]
[]Am I correct so far?
[
]Does this AS appear to be complete and functional?
[*]Where must sendmail.php be located for this script to work?[/LIST]Thanks very much.

var txtFormat:TextFormat = new TextFormat();
txtFormat.kerning = true;
txtFormat.letterSpacing = 2;
//
var bgColOff:Number = 0x000000;
var txtColOff:Number = 0xffffff;
var bgColOn:Number = 0x444444;
var txtColOn:Number = 0xffffff;
var reqStr:String = "This field is required";
var reqColor:Number = 0xff3333;
//
dir = new String(this._url);
dirIndex = dir.lastIndexOf("/");
dir = dir.slice(0, dirIndex)+"/";
//
var req:Number = 0;// using 'req' as a counter to know when required fields are all filled
var insAr:Array = new Array("name", "email", "company", "msg");

/* workaround for odd bug where 'msg' would contain a newline break
even though it doesn't exist in the authoring environment */

msg.text = "";


//
for (var i = 0; i<insAr.length; i++) {
    var ins:TextField = eval(insAr*);
    ins.onChanged = function() {
        this.setTextFormat(txtFormat);
    };
    ins.onSetFocus = function() {
        this.background = true;
        this.backgroundColor = bgColOn;
        this.textColor = txtColOn;
    };
    ins.onKillFocus = function() {
        this.background = false;
        if (this.text != reqStr) {
            this.textColor = txtColOff;
        } else if (this.text == reqStr) {
            this.textColor = reqColor;
        }
    };
}
//
_parent.btn_send.onRelease = function() {
    req = 0;
    for (var i = 0; i<insAr.length; i++) {
        checkReq(insAr*);
    }
};

function checkReq(ins) {
    ins = eval(ins);
    //
    if (ins.text == "" || ins.text == reqStr) {
        req++;
        ins.textColor = reqColor;
        ins.text = reqStr;
        ins.background = false;
        ins.setTextFormat(txtFormat);
        //
    } else if (ins.text != "" && ins.text != "This field is required") {
        req--;
    }
    if (req == (-1*insAr.length)) {
        // final check: check if email address contains proper/improper characters
        var emailTxt:String = email.text;
        var emailLen:Number = emailTxt.length;
        var dotIndex:Number = emailTxt.lastIndexOf(".");
        
        /*    ~addr.com
            length - 8
            dot index - 4
        
            ~address.pl
            length - 10
            dot index - 7
        */        
        if (emailTxt.indexOf("@") != -1 && ( dotIndex == emailLen-4 || dotIndex == emailLen-3 )) {
            // *** moved to checkValid ***
            /*trace("sendOff!!");
            _parent.play();*/
            checkValid(emailTxt)
        }
    }
    //trace(req);
}
//
function checkValid(txt) {
    var emailTxt:String = txt;
    var invalidAr:Array = new Array("~","^","&","*","(",")","/","\\");
    var num:Number = invalidAr.length;
    for (var i=0; i<invalidAr.length; i++) {
        //trace(invalidAr*);
        if (emailTxt.indexOf(invalidAr*) == -1) {
            num--;
        }
    }
    if (num == 0) {
        trace("sendOff!!");
        _parent.play();
    }
}
checkValid();
//
function sendOff() {
    mail = new LoadVars();
    mail.name = name.text;
    mail.email = email.text;
    mail.company = company.text;
    mail.msg = msg.text;
    //
    mail.sendAndLoad(dir+"sendmail.php",login,"POST");
    debug.text = "SENDING - PLEASE WAIT";
    login.onLoad = function(success:Boolean) {
        if (success) {
            debug.text = login.confirmation;
            // take action to load tracklist
        }
    };
}