Author Topic: Possible to implement formmail or a contact form?  (Read 4151 times)

Florian Nücke

  • κρύα πόδια
  • Administrator
  • Hero Member
  • *****
  • Posts: 1989
  • MegaZine3 Developer
    • MegaZine3
Re: Possible to implement formmail or a contact form?
« Reply #15 on: April 07, 2010, 07:58:22 pm »
Your problem is probably that the loader.load(request); is executed in the megazineSetup function. Meaning as soon as the SWF finished loading.

Put that line to the end of your sendMail function and it should work, i.e. like so:
Code: (actionscript)
  1. function megazineSetup(megazine:IMegaZine):void {
  2.    request  = new URLRequest(megazine.getAbsPath("email.php"));
  3.    request.method = URLRequestMethod.POST;
  4.    request.data = emailData;
  5. }
  6.  
  7. // ...
  8.  
  9. function sendMail(e:MouseEvent){
  10.    if(validere()){
  11.        statusField.text = "Sender mail, vent venligst...";
  12.  
  13.        emailData.navn = navnInput.text;
  14.        emailData.email = emailInput.text;
  15.        emailData.besked = beskedInput.text;
  16.  
  17.        loader.load(request);
  18.    }else{
  19.        statusField.text = "Udfyld venligst alle felter."
  20.    }
  21. }
For the Snark was a Boojum, you see.

Before you ask a question
          After you get an answer
  • please document your problem with the answer in the Project Wiki. (e.g. in the FAQs)
  • help others out if you can, by answering their questions on the forum.

Attention

  • Newbie
  • *
  • Posts: 23
Re: Possible to implement formmail or a contact form?
« Reply #16 on: April 08, 2010, 11:01:42 am »
WOW great it worked :)!

Is there an easy way to add a checkbox?

i tried adding emailData.checket = checketInput.CheckBox;

but no luck

Florian Nücke

  • κρύα πόδια
  • Administrator
  • Hero Member
  • *****
  • Posts: 1989
  • MegaZine3 Developer
    • MegaZine3
Re: Possible to implement formmail or a contact form?
« Reply #17 on: April 08, 2010, 01:48:50 pm »
Have a look at the components the Flash IDE offers (i.e. in the "Window" menu click "Components" [Ctrl+F7]).
There's a checkbox, too.
For the Snark was a Boojum, you see.

Before you ask a question
          After you get an answer
  • please document your problem with the answer in the Project Wiki. (e.g. in the FAQs)
  • help others out if you can, by answering their questions on the forum.