Flaş / Actionscript 2.0 'dan e-posta gönderme

0 Cevap php

Burada Noob AS Komple Flash /. Arkadaşa e-posta adresi bir değişiklik istedi ve ben yardım ediyorum. Ben bir komut dosyası yazabilirsiniz ben bir formmail.php dosyasına nakleder altındaki fark ama daha kolay bir yolu ya da POST yöntemleri kolları AS belki birisi bana mesaj bu tam olarak ne anlamak ve nasıl olabilir oldu merak ediyordum . formmail.php bazı yazı olduğu gibi "Andrew Riley (webmaster@boaddrink.com)"

function playTier() {

    switch(this.tierContent.tier_txt.text) {
        case "Sinking Ship":
            bullseye_mc.arrow_ani._x = 205; break;
        case "Piggy Bank":
            bullseye_mc.arrow_ani._x = 180; break;
        case "Loose Change":
            bullseye_mc.arrow_ani._x = 155; break;
        default:
            trace("error for arrow posX")
        }   
    bullseye_mc.arrow_ani.play();
    sendEmail();

}

tierContent._alpha = 100;

var recipient = "user@website.com";
var subject = "AP Form";
var nameField:String;
var emailField:String;
var phoneField:String;
var commentsField:String;

//alert format
var alertFormat = new TextFormat();
alertFormat.color = 0xFF0000;
var fields:Array = new Array("name_txt", "email_txt", "phone_txt", "comments_txt");

function alertField():Boolean {
    var checkFailure:Number = 0;
    for (i=0; i<fields.length; i++) {
        if (this[fields[i]].length<1) {
            checkFailure++;
            trace(checkFailure+"-checkFailure");
            this[fields[i]].text = "Required!";
            this[fields[i]].setTextFormat(alertFormat);

        }
    }
    if (checkFailure>0) {
        return false;
    } else {
        return true;
    }

}
function successWindow() {
    this.createTextField("my_txt",1,90,212,300,0);
    this.my_txt.background = true;
    this.my_txt.backgroundColor = 0x00CC00;
    my_txt.multiline = true;
    my_txt.autoSize = true;
    my_txt.wordWrap = true;
    var my_fmt:TextFormat = new TextFormat();
    my_fmt.color = 0xFFFFFF;

    my_fmt.size = 11;
    my_fmt.font = "Verdana";
    my_txt.text = "Thank You. Your information has been submitted.";
    my_txt.setTextFormat(my_fmt);
}

function progressWindow() {
    this.createTextField("progress_txt",1,90,212,300,0);
    this.progress_txt.background = true;
    this.progress_txt.backgroundColor = 0xFD530B;
    progress_txt.multiline = true;
    progress_txt.autoSize = true;
    progress_txt.wordWrap = true;
    var progress_fmt:TextFormat = new TextFormat();
    progress_fmt.color = 0xFFFFFF;

    progress_fmt.size = 11;
    progress_fmt.font = "Verdana";
    progress_txt.text = "Transmitting your information.";
    progress_txt.setTextFormat(progress_fmt);
}

function sendEmail() {
    switch (alertField()) {
        case true :
            progressWindow()
            trace("break!");
            var result_lv:LoadVars = new LoadVars();

            result_lv.onLoad = function(success:Boolean) {
                if (success) {
                    trace("Form sent!");
                    successWindow();
                } else {
                    trace("Error in sending");

                }
            };
            var send_lv:LoadVars = new LoadVars();
            send_lv.recipient = "user@website.com";
            send_lv.subject = "AP Form";
            send_lv.sort = "order:name,company,email,phone,question1,question2,question3,question4,question5,question6,question7,question8"
            send_lv.name = this._parent.q9.name_txt.text;
            send_lv.company = this._parent.q9.company_txt.text;
            send_lv.email = this._parent.q9.email_txt.text;
            send_lv.phone = this._parent.q9.phone_txt.text;

            send_lv.question1 = this._parent._parent.qArray[0];
            send_lv.question2 = this._parent._parent.qArray[1];
            send_lv.question3 = this._parent._parent.qArray[2];
            send_lv.question4 = this._parent._parent.qArray[3];
            send_lv.question5 = this._parent._parent.qArray[4];
            send_lv.question6 = this._parent._parent.qArray[5];
            send_lv.question7 = this._parent._parent.qArray[6];
            send_lv.question8 = this._parent._parent.qArray[7];


            send_lv.sendAndLoad("formmail.php",result_lv,"POST");




                if(lvBytesLoaded < lvBytesTotal) {
                     progressWindow()
                    }


            break;
        case false :
            trace("Error missing fields- nothing sent");
            break;
        default :
            trace("Something bad happen");
            break;
    }
};

0 Cevap