12 Replies Latest reply on Oct 17, 2007 3:58 PM by kglad

    FLash button and PayPal

    micgamb Level 1
      Hallo everybody,
      I have created a flash site in Flash 8 where I wil sell some t-shirts.
      Now I have created a "Shopping Cart" within PayPal.
      PayPal gave me the HTML code that I can use for my "Buy" buttons and "Check Out" button.
      Because the buttons of my site are made with Flash which is the ActionScript command that I have to use to include the belowed code?
      This code is referred to a Tee called "crazy printer" which cost €30 +€4 for shipping fees
      thank you so much for your precious help

      <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
      <input type="image" src="https://www.paypal.com/it_IT/i/btn/x-click-but22.gif" border="0" name="submit" alt="Effettua i tuoi pagamenti con PayPal. un sistema rapido, gratuito e sicuro.">
      <img alt="" border="0" src="https://www.paypal.com/it_IT/i/scr/pixel.gif" width="1" height="1">
      <input type="hidden" name="add" value="1">
      <input type="hidden" name="cmd" value="_cart">
      <input type="hidden" name="business" value="info@studiosimultaneo.com">
      <input type="hidden" name="item_name" value="crazy printer">
      <input type="hidden" name="amount" value="30.00">
      <input type="hidden" name="shipping" value="4.00">
      <input type="hidden" name="buyer_credit_promo_code" value="">
      <input type="hidden" name="buyer_credit_product_category" value="">
      <input type="hidden" name="buyer_credit_shipping_method" value="">
      <input type="hidden" name="buyer_credit_user_address_change" value="">
      <input type="hidden" name="no_shipping" value="0">
      <input type="hidden" name="no_note" value="1">
      <input type="hidden" name="currency_code" value="EUR">
      <input type="hidden" name="lc" value="IT">
      <input type="hidden" name="bn" value="PP-ShopCartBF">
      </form>
        • 1. Re: FLash button and PayPal
          kglad Adobe Community Professional & MVP
          use the LoadVars() class to add those variables/values to a loadvars instance. append the add variable/value to your sendAndLoad() url.
          • 2. Re: FLash button and PayPal
            micgamb Level 1
            thank you for your reply. Could you be more specific?
            let's say that the button that triggers the action is called "tee1_bt" how do I use loadvar() comand? can you tell me where I can look to understand much more how it works?
            thank so much for your precious help

            that code is:
            <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
            <input type="image" src="https://www.paypal.com/it_IT/i/btn/x-click-but22.gif" border="0" name="submit" alt="Effettua i tuoi pagamenti con PayPal. un sistema rapido, gratuito e sicuro.">
            <img alt="" border="0" src="https://www.paypal.com/it_IT/i/scr/pixel.gif" width="1" height="1">
            <input type="hidden" name="add" value="1">
            <input type="hidden" name="cmd" value="_cart">
            <input type="hidden" name="business" value="info@studiosimultaneo.com">
            <input type="hidden" name="item_name" value="crazy printer">
            <input type="hidden" name="amount" value="30.00">
            <input type="hidden" name="shipping" value="4.00">
            <input type="hidden" name="buyer_credit_promo_code" value="">
            <input type="hidden" name="buyer_credit_product_category" value="">
            <input type="hidden" name="buyer_credit_shipping_method" value="">
            <input type="hidden" name="buyer_credit_user_address_change" value="">
            <input type="hidden" name="no_shipping" value="0">
            <input type="hidden" name="no_note" value="1">
            <input type="hidden" name="currency_code" value="EUR">
            <input type="hidden" name="lc" value="IT">
            <input type="hidden" name="bn" value="PP-ShopCartBF">
            </form>

            • 3. Re: FLash button and PayPal
              kglad Adobe Community Professional & MVP
              :

              • 4. Re: FLash button and PayPal
                micgamb Level 1
                thanks again,
                I have written your code like this:
                tee1_bt.onRelease = function () {
                sendLV=new LoadVars();
                receiveLV=new LoadVars();
                sendLV.cmd="_cart";
                sendLV.business="info@studiosimultaneo.com";
                sendLV.bn="PP-ShopCartBF";
                sendLV.sendAndLoad("https://www.paypal.com/cgi-bin/webscr?add=1",receiveLV,"POST");
                };
                stop();

                The button tries to connec to to PayPal but nothing happen. Where do I attach the whole PayPal code ?
                sorry if I hassle you but I'am a sort of beginner of ActionScript
                • 5. Re: FLash button and PayPal
                  kglad Adobe Community Professional & MVP
                  that's the dot dot dot. assign all the variables and their values to sendLV.
                  • 6. Re: FLash button and PayPal
                    micgamb Level 1
                    help!!
                    I have been trying to understand what to write on the "dots, dots, dots" part and think I have missed a comand.

                    I did tried like this (I put some space between the right code that klad gave me and my "dots, dots" one:
                    i do not think is a Paypal wrong code but if it is please let me know.
                    thank you so much
                    • 7. Re: FLash button and PayPal
                      micgamb Level 1
                      after a few trial we came up with this code . Flash states that it has not errors in it but still it does not connect with paypal when published on th net. When we paly the swf in remote computer it tries to connect to the Paypal website. following I attached the code given from Paypal related to a button called "taglia_s":

                      taglia_s.onRelease = function (){
                      sendLV=new LoadVars();
                      receiveLV=new LoadVars();
                      sendLV.cmd="_cart";
                      sendLV.business="info@studiosimultaneo.com";
                      sendLV.item_name ="crazy printer";
                      sendLV.amount ="32.00";
                      sendLV.shipping ="4.00";
                      sendLV.buyer_credit_promo_code ="";
                      sendLV.buyer_credit_product_category ="";
                      sendLV.buyer_credit_shipping_method ="";
                      sendLV.buyer_credit_user_address_change ="";
                      sendLV.no_shipping ="0";
                      sendLV.no_note ="1";
                      sendLV.currency_code ="EUR";
                      sendLV.lc ="IT";
                      sendLV.bn="PP-ShopCartBF";
                      sendLV.sendAndLoad("https://www.paypal.com/cgi-bin/webscr?add=1",receiveLV,"POST");
                      };
                      stop();

                      could somebody tell me where I make the mistake? Thank you so much
                      • 8. Re: FLash button and PayPal
                        kglad Adobe Community Professional & MVP
                        no, that's not going to work. look, i already encoded:

                        • 9. Re: FLash button and PayPal
                          micgamb Level 1
                          thank you so much for the reply..but what do you mean by "encoding"?
                          sorry to be so "dull" but it is a bit hard to understand how it works..
                          I have translated the HTML code in a similar way that you had done the first bit.

                          this is yours:

                          /* html code begin
                          <input type="hidden" name="cmd" value="_cart">
                          <input type="hidden" name="business" value="info@studiosimultaneo.com">
                          */ html code end

                          // translates to:

                          sendLV.cmd="_cart";
                          sendLV.business="info@studiosimultaneo.com";

                          and this is mine:
                          <input type="hidden" name="item_name" value="crazy printer">
                          <input type="hidden" name="amount" value="30.00">
                          <input type="hidden" name="shipping" value="4.00">

                          translates to:
                          sendLV.item_name ="crazy printer";
                          sendLV.amount ="32.00";
                          sendLV.shipping ="4.00";

                          so..what the is the complete right code that I have to use starting from the trigging "comand taglia_s . onRelease = function..."and so on ?

                          thank you so much you have been very helpful . this part of my website is the most important one, without this nothing will "work". thank you again

                          • 10. Re: FLash button and PayPal
                            kglad Adobe Community Professional & MVP
                            by "encoding" i meant translating the html form to actionscript.

                            and you did that perfectly in your above message and also in a message dated/timed 10/16/2007 03:23:56 PM that i hadn't seen before.

                            try changing your sendAndLoad() to a send so you can open a new window to paypal:



                            • 11. Re: FLash button and PayPal
                              micgamb Level 1
                              thank thank you so much!! it works !!! Thank you so much again! without your suggestions I would have never make it
                              • 12. Re: FLash button and PayPal
                                kglad Adobe Community Professional & MVP
                                you're welcome.