A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: forms in swish max

  1. #1
    Web Architect
    Join Date
    Jun 2002
    Location
    New Haven, CT
    Posts
    94

    forms in swish max

    OK....here my problem:

    I download the sample files posted here on how to create a simple contact form in swishmax. I read the instructions carefully, and am fairly sure that everything was done as written (note, I have created forms in flash and loaded into swish and have them worked fine before, but now want to be able to do it completely in swishmax). continuing, I created a movie and wanted to use the form in my movie, so at first attempt, i copied the files into my movie with all the scripts, and placed everything on my PHP enabled server, including the PHP files which was changed to send to my email. when tested, and I hit send...the form just hangs saying it is sending...but nothing shows up in my email. then I tried loading the form instead into my movied (both into sprite and level 1) and got the same thing. Can someone help me figure out what i am doing wrong, or is there something with the scripts, or loadmovie function in swish max. I am totally stunned at how diff this has become....for me.

    www.megastaffing.com

    You can see the form here...just hanging.

    PS: do it matter where a form is placed in a movie? Does it need to be put into a sprite? or level? or can it be create at _root level of the movie?

    The tuturial says it can be loaded into any level...but it does not seem to work that way. By itself as a movie it works fine....but when loaded into a sprite/level...it just hangs...as tho i cannot pass the variable to the php file on the server.

    Does anyone know where i can download an acutal swishmax movie with a mail form created in it...so I can see the proper structure? Or if someone could be so kinda as to create a dummy movie with extra content and effects in swishmax with a contact created in it so i can look at the structure.

    dan.
    Last edited by praitie; 11-01-2003 at 11:47 AM.

  2. #2
    Senior Member Dead Rabbit's Avatar
    Join Date
    Oct 2002
    Location
    Back in Tampa FLA again - and happy!
    Posts
    2,403
    Post the .swi (or enough of it to show the forum & scripting) so we can take a look & troubleshoot.
    While changing my profile, I accidentally clicked the link that said
    "Add 'Dead Rabbit' to your Ignore List"
    so now I can't talk to myself anymore...

    The Repository -:- The Forum

  3. #3
    Web Architect
    Join Date
    Jun 2002
    Location
    New Haven, CT
    Posts
    94
    The source files can be found here...

    www.praitie.com/mega/demo.swi
    www.praitie.com/mega/contact.php
    www.praitie.com/mega/index.swi (this is the original email form taken from swish-deb)


    thanx for all help.

    praitie

  4. #4
    Junior Member
    Join Date
    Nov 2003
    Posts
    24
    I know this isn't the swishscript answer, but it might help... why don't you use the LoadVars() object? Don't take this code for 100% correct because I usually screw something up first but something like:

    sendEmail = new LoadVars();
    sendEmail.email = emailaddress;
    sendEmail.firstname = firstname;
    sendEmail.lastname = lastname;
    sendEmail.message = message;
    sendEmail.sendAndLoad("contact.php", this);
    sendEmail.onLoad = function(success) {

    }

  5. #5
    Flashkit historian Frets's Avatar
    Join Date
    Oct 2000
    Location
    flashkit
    Posts
    8,797
    Praitie,

    Please zip the php
    it cannot be viewed in browser or downloaded
    in that manner all one recieces is the output.

    Frets

  6. #6
    Web Architect
    Join Date
    Jun 2002
    Location
    New Haven, CT
    Posts
    94
    the zip file is

    www.praitie.com/mega/contact.zip


    thanx for all your help.

    Frets u rule
    Last edited by praitie; 11-01-2003 at 02:12 PM.

  7. #7
    Web Architect
    Join Date
    Jun 2002
    Location
    New Haven, CT
    Posts
    94
    Kastro:

    Thanx for the input...but I am not very savvy on the php programming...my understanding of it is beginner level...just learning as I go. so tho i understand what your saying...I am not sure how to apply it. Perhaps, if you could explain...like I am infant....that might help...smile.


    thanx.

    praitie

  8. #8
    Web Architect
    Join Date
    Jun 2002
    Location
    New Haven, CT
    Posts
    94
    http://www.swish-db.com/forum/index....pic=6218&st=0&

    link to instructions for the form that i am trying to get to work

    praitie

  9. #9
    Junior Member
    Join Date
    Nov 2003
    Posts
    24
    pratie,

    The code that I put up there is not php, it is actionscript. In your demo.swi I saw that you used LoadVariables. There is a replacement for that and that is the LoadVars object in actionsript/swishscript. Basically the code I put up there you start a new LoadVars object, put the variables in the object, run the sendAndLoad method to send the variables and load the result, and then you use the onLoad method to capture the result.

    As far as the php side goes... I assume you know how to send the email...and beyond that you just need to return the variable that it was sent... php would be something like this:

    --------start------------------
    <?
    // Receive variables from flash
    $from_email = $_REQUEST['email'];
    $from_fname = $_REQUEST['firstname'];
    $from_lname = $_REQUEST['lastname'];
    $message = $_REQUEST['message'];

    // Set subject and your email address
    $subject = "Contact Me";
    $to_email = "[email protected]";
    if (mail($to_email, $subject, $message, "From: $from_fname $from_lname <$from_email>")) {
    echo "result=Email+was+sent";
    }
    else {
    echo "result=There+was+an+error";
    }
    ?>
    ---------end--------------------

    Hope this helps...

  10. #10
    Senior Member Dead Rabbit's Avatar
    Join Date
    Oct 2002
    Location
    Back in Tampa FLA again - and happy!
    Posts
    2,403
    since the form was distributed by Swish-DB, your best bet is to ask them for help in supporting it. We can only guess at the intent of their code, and some of their .swi require flash-made plugins in order to work.
    While changing my profile, I accidentally clicked the link that said
    "Add 'Dead Rabbit' to your Ignore List"
    so now I can't talk to myself anymore...

    The Repository -:- The Forum

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