A Flash Developer Resource Site

Results 1 to 13 of 13

Thread: Send variables to the ASP page

  1. #1
    Older Member jankratochvil's Avatar
    Join Date
    Nov 2001
    Location
    CZECH
    Posts
    977

    Send variables to the ASP page

    I have problem:
    I send the variables and I need to prevent SWF not open new window in browser.
    I tried to use "_self" parameter, but the window is still open.
    Why?
    Code:
                    SendMail = new LoadVars();
    			SendMail.email = email_txt.text;
    			SendMail.subject = subject_txt.text;
    			SendMail.body = body_txt.text;
    			SendMail.send("forms/send_mail.asp", "_self", "POST");
    			trace("checked = "+checked);
    			trace("variables sended to the ASP page");
    			email_txt.text = "";
    			subject_txt.text = "";
    			body_txt.text = "";
    I like all FLASH fans, but my girl can't stand them.
    -------------------------------------------
    I am still learning
    Sorry for my stupid questions (sometimes) and bad English.

  2. #2
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    Dont use anything for that argument. Skip it completely.

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  3. #3
    Older Member jankratochvil's Avatar
    Join Date
    Nov 2001
    Location
    CZECH
    Posts
    977
    I tried it but if i click btn for sending it opens the ASP page. ;(
    Code:
    SendMail = new LoadVars();
    			SendMail.email = email_txt.text;
    			SendMail.subject = subject_txt.text;
    			SendMail.body = body_txt.text;
    			SendMail.send("forms/send_mail.asp", "POST");
    			trace("checked = "+checked);
    			trace("variables sended to the ASP page");
    			email_txt.text = "";
    			subject_txt.text = "";
    			body_txt.text = "";
    I like all FLASH fans, but my girl can't stand them.
    -------------------------------------------
    I am still learning
    Sorry for my stupid questions (sometimes) and bad English.

  4. #4
    Older Member jankratochvil's Avatar
    Join Date
    Nov 2001
    Location
    CZECH
    Posts
    977

    Re: Problem still not solved, please help

    Here is example of the problem.
    Here is the source FLA.
    Why this action opens the lilnk with ASP page?

    Thank you
    Attached Files Attached Files
    Last edited by jankratochvil; 07-18-2005 at 01:58 PM. Reason: Changed FLA from MX 2004 to MX
    I like all FLASH fans, but my girl can't stand them.
    -------------------------------------------
    I am still learning
    Sorry for my stupid questions (sometimes) and bad English.

  5. #5
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    Its better to post MX fla files as more people can view them. Im on MX so I could not open it.

    Your test page did not open a new window here. Mac OS 9.1 IE 5.0 . On the other hand it did not seem to sen anything either , it just got stuck.

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  6. #6
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    You can also try with a this action on the button...

    email = email_txt.text;
    subject = subject_txt.text;
    body = body_txt.text;
    this.loadVariables("forms/send_mail.asp","POST");

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  7. #7
    Older Member jankratochvil's Avatar
    Join Date
    Nov 2001
    Location
    CZECH
    Posts
    977
    Thank you for answers pelle
    You are right I changed the FLA to MX, sorry.
    I like all FLASH fans, but my girl can't stand them.
    -------------------------------------------
    I am still learning
    Sorry for my stupid questions (sometimes) and bad English.

  8. #8
    Older Member jankratochvil's Avatar
    Join Date
    Nov 2001
    Location
    CZECH
    Posts
    977
    Thank in this way it works.

    I used loadVariables before.

    I tried to use loadVars();, but it has the problem what I posted above.

    Thanks

    Quote Originally Posted by pellepiano
    You can also try with a this action on the button...

    email = email_txt.text;
    subject = subject_txt.text;
    body = body_txt.text;
    this.loadVariables("forms/send_mail.asp","POST");
    I like all FLASH fans, but my girl can't stand them.
    -------------------------------------------
    I am still learning
    Sorry for my stupid questions (sometimes) and bad English.

  9. #9
    Senile member! :)
    Join Date
    Dec 2001
    Location
    Saunaswamp (transl)
    Posts
    2,296
    When using LoadVars you should use sendAndLoad() instead of send().

    From the reference on LoadVars.send():
    If you would rather send information to a server and continue playing your SWF file without opening a new window or replacing content in a window or frame, then you should use LoadVars.sendAndLoad().
    /Mirandir
    Last edited by Mirandir; 07-18-2005 at 02:33 PM. Reason: Shortened the Quote

  10. #10
    Older Member jankratochvil's Avatar
    Join Date
    Nov 2001
    Location
    CZECH
    Posts
    977
    Thank you Mirandir!
    But why will be open the window if I use LoadVars.send():.
    Is i curious for me
    ??
    I like all FLASH fans, but my girl can't stand them.
    -------------------------------------------
    I am still learning
    Sorry for my stupid questions (sometimes) and bad English.

  11. #11
    Older Member jankratochvil's Avatar
    Join Date
    Nov 2001
    Location
    CZECH
    Posts
    977
    You are right Mirandir it works, thanks again!
    Jan
    I like all FLASH fans, but my girl can't stand them.
    -------------------------------------------
    I am still learning
    Sorry for my stupid questions (sometimes) and bad English.

  12. #12
    Senile member! :)
    Join Date
    Dec 2001
    Location
    Saunaswamp (transl)
    Posts
    2,296
    Thank you Mirandir!
    But why will be open the window if I use LoadVars.send():.
    Is i curious for me
    The send method is used when you wan't to send the varibles to a page and make that page replace the current page, open in a window or open in a html-frame.

    /Mirandir
    Last edited by Mirandir; 07-18-2005 at 06:45 PM.

  13. #13
    Older Member jankratochvil's Avatar
    Join Date
    Nov 2001
    Location
    CZECH
    Posts
    977
    Thank you.
    I like all FLASH fans, but my girl can't stand them.
    -------------------------------------------
    I am still learning
    Sorry for my stupid questions (sometimes) and bad English.

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