A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: A desperate cry for help!....

  1. #1
    Griffhiggins 2.2 clifgriffin's Avatar
    Join Date
    May 2001
    Location
    Your Bathroom! Bwahahaha!
    Posts
    1,383
    Okay, I'm having a basic understanding problem.

    I have several input text fields. I need to take the text in these fields pass it to an asp page which will email them to me.

    1. I assume I have to enter a variable name into the var field in each text boxes properties.

    2. How does the loadVariable method know which variables to load. More importantly, how do I use this command to send data from say a name, email, phone fields to an asp page.

    3. What method should I use in the ASP page to retrieve this data. I've used request.form in the past when gathering data from html fields. How does this work with gathering data from Flash?

    Keep in mind that I'm neither a AS expert or a ASP expert. I can get around but take it slow.

    If you can help me with this, you'll be my hero. :}

    Thanks in advance...

    P.S. To see the page I'm trying to do this with, go to http://www.wyoa.com. Click on contact. Thanks.

  2. #2
    Junior Member
    Join Date
    Oct 2000
    Posts
    22
    If you've got the ASP file to process and HTMl form, then you should have no probs gettign a flash form to do teh same.

    Basically, if you use loadvariables, ALL teh variables get sent and as it is therefore better to send them as post rather than get. This also makes more sense if you are using the request.form method to retrieve the variables.

    Assumign you have a workign HTML / ASP example is:
    name the input fields in your flash movie to the same as the form fields in your working HTML form.
    enter teh load variables script on a button, along with a command to start a movie clip laying in order to check for an output variable from the ASP acript so tha teh flash movie can check that teh email has been sent.
    Ensure that the variables correctly to teh variable names used in the flash movie (this should be a given if you've simply transposed teh form fields from a workign HTML / ASP setup)
    At the end of the mail script, use response.write to print a variable i.e. email_sent=true.
    Having received the aforementioned variable from the ASP script, the movie clip that you started on the aforementioned submit button can make something happen, i.e. make the movie jump to a "thank you for your message, we'll get back to you soon" message.

    Hope this helps

  3. #3
    Griffhiggins 2.2 clifgriffin's Avatar
    Join Date
    May 2001
    Location
    Your Bathroom! Bwahahaha!
    Posts
    1,383
    Thank you!

    Couple things...

    Where do I name the text fields? Instance name or Var box?

    Can you provide a code example of how I would initiate the mc that checks the status AND how the MC checks the status?


    Thank you so much!!!


  4. #4
    Aquarium drinker
    Join Date
    Nov 2000
    Location
    Greater than 45 degrees in Minkowski space
    Posts
    571
    The var field is deprecated in Flash MX. You should use the Instance name field and get the value of the textfield using instanceName.text .

    Additionally, the MC loop is deprecated as well. The LoadVars object now allows you to set a callback function on onLoad. You should check it out in the AS dictionary.

  5. #5
    Griffhiggins 2.2 clifgriffin's Avatar
    Join Date
    May 2001
    Location
    Your Bathroom! Bwahahaha!
    Posts
    1,383
    Okay, I'm almost there.

    I'm getting the email, but it's blank of any of the information.

    Here's a link to my ASP code. (Server names modified)

    http://www.wyoa.com/DoSendContact.txt

    Here's a link to my Flash code. (Server names modified.)

    http://www.wyoa.com/code.txt

    I put the mx code into a function called "send", as I'm using the xp component button... Do see a problem with my code?

    I've also named each of the fields in the instance name box.

    As you can see it writes the status of the proceedure in a dynamic field called "statustext".

    Any help you can give me, I would greatly appreciate!

    Thanks in advance...

  6. #6
    Junior Member
    Join Date
    Oct 2000
    Posts
    22
    I realise that my methodis now out of date with MX (read, will still work, but there is a more efficient way), but as far as what you've done...

    Firstly, I'm assumign that the naems of your variables in teh movie are named accordingly i.e. your script looks for
    Request.Form( "company" ) + " " + Request.Form( "first_name" ) + " " + Request.Form( "last_name" ) + "<br>" + Request.Form( "project" ) + "<br>" + Request.Form( "Budget" ) + "<br>" + Request.Form( "state" ) + "<br>" + "<br>" + Request.Form( "zip" ) + "<br>" + Request.Form( "phone" ) + "<br>" + Request.Form( "email" ) + "<br>" + "<br><br><br>" + Request.Form( "message" )
    At any rate, I'd probably use a process of elimination and set the message body to somethign dead simple like:
    objMail.Body = "FLash Mail body"
    Assuming that works, any probelsm you are having would appear to be down to mapping your flash variables to the properties of your mail object.

    Also, as much as there may be a newer way to do it, I'd use your:
    If Err <> 0 Then
    Response.Write( "finished=false" + "<br>" + chr( 13 ) + chr( 10 ) )
    Else
    Response.Write ("finished=true" + chr ( 13 ) + chr ( 10 ) )
    nCount = nCount + 1
    End If
    as the confirmation variable that Flash uses to check if the mail has been sent correctly rather than just assume it has based on your valiadtion function i.e. change the else clause to read:
    } else {
    loadVariables("http://www.wyoa.com/send.asp", this, "POST");
    _root.mailchecker.play()}
    mailchecker would then be a MC that loops between frames 3 and 2, with a conditional statement in frame 3 that checks to see if finished==true, in which case the mailchecker MC goes to and stops at frame 1 and teh _root, or another MC, or whatever displays a mail thank you / confirmation message.

    Hope this helps

    P.S. I can;t see any reason for the conditional statement at teh end of teh ASP code.

  7. #7
    Griffhiggins 2.2 clifgriffin's Avatar
    Join Date
    May 2001
    Location
    Your Bathroom! Bwahahaha!
    Posts
    1,383
    Okay, I set up a quick Html page that used the same form names and it worked.

    It seems to be a flash problem.

    I need something to be verified. Do you name the text fields in Flash under instance name?

    In other words,

    If my asp page requests from a form called "email", my text field's instance in flash must be named "email", correct?

    I'm so close but yet so far. Can you look at my Flash code one more time??

    Here's my flash source file...

    http://www.wyoa.com/ftp/contact.zip

    Thanks in advance!

  8. #8
    Griffhiggins 2.2 clifgriffin's Avatar
    Join Date
    May 2001
    Location
    Your Bathroom! Bwahahaha!
    Posts
    1,383

    Smile I figured it out!

    It was too simple! I had to name the box in the var field. NOT the instance name.

    Thank you so much for your help.


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