Welcome, Guest
  • Author Topic: Need help, please... confirming message doesn't show  (Read 2900 times)

    trudiemaria

    • Server what's that
    • *
    • Posts: 7
      • View Profile
      • KIKK
      • Email
    Hey,

    Could anyone please help me?
    I had my cards running just fine, but now I've rearranged my sites and all of my fla files, and now the confirmation (your email has been send), doesn't work anymore. Everything else just works fine....
    You'll find my site on http://www.kikk.info

    sincerely yours,
    Trudie
    don't be afraid to be different

    Musicman

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 2685
      • View Profile
      • Email
    Hi,

    the server says that the message was sent, but flash is not listening amymore. Are you sure that _root.Sukses is the variable name of the text field that will display the message?

    BTW: flash mx and 2004 offer the loadvars object as a replacement  for loadvariables - and the addition of  components usually sends a lot of useless variables via the old ,method, e.g. FUIComponentClass=[type Function]

    Musicman

    trudiemaria

    • Server what's that
    • *
    • Posts: 7
      • View Profile
      • KIKK
      • Email
    Hey again,

    I've tried to give the dynamic textfield different var. names, (and changed simultaneously the name on the SendEcard.php), but that doesn't seem to help.
    I am using Flash mx 6.0 and will send you my Ecards fla file, Could you be so kind and take a look at it? I hope that you'll find out what I've been doing wrong.

    Here's my SendMail.php

    <?

    $CreateEcard = date(U);

    $filename = $CreateEcard.".txt";

    $ToName = stripslashes($ToName);
    $FromName = stripslashes($FromName);
    $Greeting = stripslashes($Greeting);
    $IntroMessage = stripslashes($IntroMessage);
    $EndMessage = stripslashes($EndMessage);

    $Today = (date ("l dS of F Y ( h:i:s A )",time()));

    $Created="Ecard Created on $Today";

    $EcardNum = $EcardSelect;

    $EcardText = "ToName=$ToName&ToEmail=$ToEmail&FromName=$FromName&FromEmail=$FromEmail&Greeting=$Greeting&IntroMessage=$IntroMessage&Created=$Created";


    $fp = fopen( "./dBText/$filename","w");
    fwrite($fp, $EcardText, 10000);
    fclose( $fp );

    ######Email Card########
    ## You can change the subject and the message part around.
    ## Make sure to change the Link as stated in the Tutorial.
    ## (Change from 'someSite' to your actual site - leave the rest the same


    $ToSubject = "Du har fått et emailkort av $FromName";
    $Message = "$ToName,\nDu har fått et flashkort fra $FromName. \nKlikk og kikk på ditt kort:\n\n
    http://www.kikk.info/SelectCard.php?EcardText=$CreateEcard&ENum=$EcardNum\n\n-----------------------------------\nHer er meldingen som ble send:\n$ToName,\n$Greeting\n$IntroMessage\n\n-$FromName\n\n\n-----------------------------------\nDette kortet har blitt send med Kikk.info";


    ###################
    ## This line actually sends the email - you should not have to change this.

    mail($ToName." <".$ToEmail.">",$ToSubject, $Message, "From: ".$FromName." <".$FromEmail.">");


    ## This next line returns a success message to the movie.
    print "_root.Sukses=Gratiss, ditt kort har blitt send";
    ?>
    [/table]

    Thanks for taking the time to help me, I appreciate it very much!!
    don't be afraid to be different

    trudiemaria

    • Server what's that
    • *
    • Posts: 7
      • View Profile
      • KIKK
      • Email
    By the way,

    Might it be the problem that the php print addressing is wrong?
    It's supposed to send the print message to my Ecards.swf file.
    My Ecards.swf is on level 1 (index.html contains Menu.swf (level 0), with Ecards.swf on top with level 1),
    When the php print says:  print "_root.Sukses= blabla", is it then trying to reach the Menu.swf  ???
    don't be afraid to be different

    Musicman

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 2685
      • View Profile
      • Email
    Quote
    is it then tryimg[/qiote]

    I fear so...
    It is generally a good idea to replace oöd code based on loadvariablesNUM by either loadvariables (for flash 5) or by loadvars methodes for mx, for two reasons:
    a) you have more control over the vriables that are sent
    b) you can design movies so they work by themselves and when loaded into a container
    Now the third one is specific for loadvars: you can find out whether you really get connected to the server

    Musicman

    trudiemaria

    • Server what's that
    • *
    • Posts: 7
      • View Profile
      • KIKK
      • Email
    Dear musicman,

    I am afraid that I didn't understand what you mend in your quote.....
    What especially must I change in order to get it working?

    A dynamic textfield is just the same in either flash version (isn't it?),
    The flash file works fine in order to send the var. to the php, the problem is that the php doesn't send it's feedback to the flash again.

    so I guess I'll have to change the code (or the addressing to the dynamic textfield on level 1) in the SendEcard.php, but, in to what?

    Please use an easy kind of explanation, for my knowledge of actionscript is still rather poor....
    Thanks for your helping hand!

    Trudie
    don't be afraid to be different

    Musicman

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 2685
      • View Profile
      • Email
    Hi,

    here is fragment for sending the data to server (for MX or later)
    Code: [Select]
            } else {
                    gotoAndStop(4);
                    ukses = "Holder på å sende ekortet - vennligst vent...";
                    mylv = new LoadVars();
                    myreply = new LoadVars();
                    mylv.ToName = ToName;
                    mylv.FromName = FromName;
                    mylv.ToEmail = ToEmail;
                    mylv.FromEmail = FromEmail;
                    mylv.IntroMessage = IntroMessage;
                    myreply.onLoad = function  () {
                           Sukses = this.Sukses;
                    };
                    mylv.sendAndLoad("SendEcard.php", myreply, "POST");
            }
    }

    See the tutorials on loading and saving too...
    Note I removed all _root since these textfields are in the same timeline as the inputs and the button - in other situations you would wamt relative addresses like _parent

    The _root also is no longer needed in the php file - if your output field is in a different environment than the othersm the code in the onload function would take care of this rather than the server side

    Musicman

    trudiemaria

    • Server what's that
    • *
    • Posts: 7
      • View Profile
      • KIKK
      • Email
    Thanks very much!

    Finally I've got it working all just fine!
    I had to make small adjustments to your script. The variable:

                mylv.Sukses = Sukses;
                mylv.EcardSelect = EcardSelect;

    were not included, thus the confirming message didn't show and although there was a message send to the replient, there was no card number attached, so no card came up.

    I still don't understand the 'load variables action', but will take me the time to learn it!
    Flash is so complex, and so fantastic! just love it....
    don't be afraid to be different