Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 951059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:40:12+00:00 2026-05-15T23:40:12+00:00

Complete Flash / AS Noob here. Friend wanted a change in Email address and

  • 0

Complete Flash / AS Noob here. Friend wanted a change in Email address and I’m assisting. I notice at the bottom it posts to a formmail.php file but I was wondering if there was an easier way or perhaps someone could help me understand what exactly it POSTS and how AS handles POST methods so I can rewrite a script. As formmail.php is some script from “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;
    }
};
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T23:40:12+00:00Added an answer on May 15, 2026 at 11:40 pm

    If you could post the exact change that your friend wants to make, it would be helpful in answering your question. It sounds like you just need to change the email address, though.

    A short answer to your question:

    There is some confusion built into this code – there are variables defined and populated that you would expect to be what is sent to the server. BUT, these variables are not referred to later on, when the information is being packaged up in the send_lv object to be sent up to the server.

    If you need to change the email address that the email is going to, change send_lv.recipient = "user@website.com"; to send_lv.recipient = "newEmail@domain.com", or whatever.

    You could modify to code to make use of the recipient var that is defined near the top of the code, like so:

    send_lv.recipient = recipient;

    If you do this, then you need to change var recipient = "user@website.com"; to var recipient = "newEmail@domain.com";.

    A longer answer to your question:

    It’s been a pretty long time since I’ve worked with AS2, but what the code you posted is doing, in general, is gathering the elements of an email and then sending those elements to a PHP script. The PHP script will use the elements it receives to construct and then send an email. In this case, the email will go to user@website.com, with a subject line of AP Form. My guess is that the remaining elements – name, company, email, phone, and the list of questions (or question answers, more likely) will be used to construct the body of the email.

    The send_lv object represents the information that will be sent to the server. It is also the means of sending the information to the server (send_lv.sendAndLoad()). The sendAndLoad method sends information to the server and requests a response, which in this case triggers the successWindow function. In between the time that the information is sent and the time a result is received from the server, a progress window is displayed.

    You can read up a bit on this method on the LiveDocs documentation. It’s pretty informative, and explains the difference between the sendAndLoad, send, and load methods.

    Hope that helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

complete noob to Haskell here with probably an even noobier question. I'm trying to
I'm a complete Flex/Flash noob, running Adobe Flash Builder 4 Beta 2. I have
I'm not sure if this is possible (complete non-flash developer speaking), but we have
Complete C# newbie here, so cut me some slack. I have this application that
Complete new person to Ruby and Rails here... Have tried some tutorials in the
Check out My Complete Code for uploading Video on youtube click here The problem
An other XML and Flash question. How do I change my URLRequests by XML?
I am a complete beginner in Flash & Actionscript. My pet project is this:
My question is very simple.In adobe flash files(swf) you can actually capture the complete
I am a complete novice when coming to using Flash but I am looking

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.