A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: forms and flash

  1. #1
    Board at Work
    Join Date
    Apr 2001
    Location
    New England
    Posts
    205

    forms and flash

    Hello,

    Was wondering if anyone could help with retrieving form data and mailing it in flash.

    I don't know php or asp and am looking for a simple script that will only take minor adjustingon my part.

    I tried using formail from matt's and set up the flash script easily enough but formail requires a static ip address as far as i can tell, and to to me that's useless.

    Thanks for any help you can give!

  2. #2
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi,

    would I understand that correctly: you are running your own computer as a server, via a dyndns name or similar, and want it to send mails?

    Musicman

  3. #3
    Board at Work
    Join Date
    Apr 2001
    Location
    New England
    Posts
    205
    uh, no...

    It's on a remote host.
    Hmm, how can I explain this simply...

    In Flash I have this:

    Email: (Field)
    Subject: (field)
    Message: (field)
    Submit: (button)

    I want a simple asp script that takes the information entered into the swf and than mail it to a designated email address.

    I have a simple vbscript that sends the info from html forms. I don't begin to understand how to adapt it to flash though.

    I am a designer, I only understand animation and colors! (Well, and a little bit of javascript and actionscript)

    Here is the vbscript:
    <%
    Dim objMail

    If Len(Request("email")) > 0 Then
    Set objMail = CreateObject("CDONTS.NewMail")
    objMail.From=Request("email")
    objMail.To="EMAIL ADDRESS HERE"
    objMail.Subject= Request("subject")
    objMail.Body = Request("message")
    mailres=objMail.Send()
    if NOT mailres then
    'Response.Write "<table width=90% border=0><tr><td bgcolor=#ffffff align=center>Mail sent...</td></tr></table>"
    else
    'Response.Write "<table width=90% border=0><tr><td bgcolor=#ffffff align=center>Mail send failure.</td></tr></table>"
    end if
    Response.Redirect("RESPOND PAGE URL HERE")

    End If

    set objMail = nothing
    %>

    Am I being clearer this time?
    Last edited by Docta-Fitz; 10-09-2002 at 11:32 AM.

  4. #4
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi,

    but where is the problem with variable IP then?
    Formmail usually wants your domain name in the script (to prevent spam messages) - the problem is that one particular browser does not send a valid referrer and therefore does not work too well with flash.
    If your hosting company does support asp and uses cdonts for mailing, the script is likely to work (although you should not send a response and a redirect back, only one of them)
    If your hosting company happens to support php or cgi instead, you would need a similar script

    Now, in your flash form, (assuming the text fields and the submit button are on the main timeline), just use this button scrit
    on(release) {
    getURL('yourscript.asp', '_blank', 'POST');
    }

    Musicman

  5. #5
    Board at Work
    Join Date
    Apr 2001
    Location
    New England
    Posts
    205
    Cool got it to work!

    Thanks a bunch Musicman and I apologize for my complete lack of understanding for what you just help me accomplish

  6. #6
    Member
    Join Date
    Mar 2001
    Posts
    71

    What if?

    OK, Musicman. . . .what if my "SUBMIT" button and text fields ARE NOT on the main timeline? I have these 'form widgets'(components) from the Macromedia website that are smartclips. So the "input" smartclip is an MC with another MC inside it, and then finally the textfield. How can I send those variables deep inside the smartclip to my ASP script with just one "SUBMIT" button on the main timeline? Please help. This is killing me.

  7. #7
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    I think the best way would be to use a specific sending clip / loadvars object and copy all data to it
    // button action:
    _root.data.var1 = _root.path.to.var1;
    _root.data.var2 = _root.path.to.var2;
    _root.data.loadVariables('scrip.asp', 'POST')

    Musicman

  8. #8
    Member
    Join Date
    Mar 2001
    Posts
    71

    Could you explain?

    Hey there Musicman, could you explain a bit more? I'm not an Actionscript code warrior at all si I'm not quite sure I understand what you said. I'll fool around with it and see if I can figure it out and wait for your reply. Thanks again.

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