A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: How to Target a movie clip from a CGI...

  1. #1

    resolved

    Hello,
    I have a form that resides in a movieclip. The movie clip is on a time line of an SWF that is loaded into a movie clip on a time line in the main movie. The hierarchy is as follows:

    _root.body.form

    Where ROOT is the main movie, and BODY is the instance name of the movie clip that holds the SWF that has the movie clip instance called FORM.

    The form works fine and sends out the info to email. The problem is I have a message in a dynamic text with a variable name of EmailStatus. For some reason when targeting that text variable I do not get the message returned from the CGI script. This does however work when I use a test movie, where the form resides on the main timeline.

    Here is the code on the button that sends the form:

    on (release) {
    if (!Email.length || Email.indexOf("@") == -1 || Email.indexOf(".") == -1) {
    EmailStatus = "Please enter a valid E-mail address";
    } else if (!realname.length) {
    EmailStatus = "Please Enter your name before Sending";
    } else if (!Additional.length) {
    EmailStatus = "Please enter your Comments!";
    } else {
    loadVariablesNum ("http://www.mysite.com/cgi-bin/formMailPerl.pl", "0", "POST");
    EmailStatus = "sending your info now...";
    }
    }

    and here is the bottom of the CGI form

    print "Content-type: text/html\n\n";
    print "_root.Mail.EmailStatus=Complete - Your mail has been sent";

    sub ErrorMessage {
    print "Content-type: text/html\n\n";
    print "_root.Mail.EmailStatus=Connection Failed Please Check the path to the Mail program";
    exit; }

    the only thing I can think is that the path to the form is wrong. A member named Dudo helped me out before, but his suggestion to change _root.Mail.EmailStatus to just EmailStatus kept that field from working at all. Any one know how to write the proper path to the form where it resides?
    Thanx in advance!
    -Potus

  2. #2
    Senior Member sxdesign's Avatar
    Join Date
    Aug 2000
    Location
    Serbia
    Posts
    844
    in your perl use:

    print "EmailStatus=Complete - Your mail has been sent";
    # etc.

    BUT in your Flash use:

    loadVariables("http://www.mysite.com/cgi-bin/formMailPerl.pl", "", "POST");

    or
    loadVariables("http://www.mysite.com/cgi-bin/formMailPerl.pl", "_root.Mail", "POST");

    if you run it from a different clip...

    hope it helps...



  3. #3
    this did not make the EmailStatus work correctly.

    As I said before the form does work the other way, but the CGI is not able to send the message back to the EmailStatus variable field. After changing the script as you suggest I no longer receive the mail in my inbox either.

    here is the form button with the change you specified:

    on (release) {
    if (!Email.length || Email.indexOf("@") == -1 || Email.indexOf(".") == -1) {
    EmailStatus = "Please enter a valid E-mail address";
    } else if (!realname.length) {
    EmailStatus = "Please Enter your name before Sending";
    } else if (!Additional.length) {
    EmailStatus = "Please enter your Comments!";
    } else {
    loadVariables ("http://www.collectionofone.com/cgi-bin/formMailPerl.pl", "_root.Mail", "POST");
    EmailStatus = "sending your info now...";
    }
    }

    and the CGI form as you specified

    print "Content-type: text/html\n\n";
    print "EmailStatus = Complete - Your mail has been sent";

    sub ErrorMessage {
    print "Content-type: text/html\n\n";
    print "EmailStatus = Connection Failed Please Check the path to the Mail program";
    exit; }


    this produces no results...Be fore the mail was sent but the status didn't change...so I'm still in the same boat...

    very curious. I had figured that the path in the CGI is what needs changing...

    -Potus

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center