0 Replies Latest reply on Sep 10, 2009 9:30 PM by zeeb44

    Add to Cart flash button AS3

    zeeb44 Level 1

      So... I have my code below, Everything works great. except this code is to buy now, and im trying to edit it to make it just add to cart and cant figure it out. any help please!?

       

       

      // Button Click Function like any other you would code in AS3
      function buyNowDownSmall(event:MouseEvent):void {

       

      // Here you define the URL address you want to connect to
      var url:String = "https://www.paypal.com/cgi-bin/webscr";
      // Define the URLRequest object and use url string from above
      var payPal:URLRequest = new URLRequest(url);
      // Set up URL variables object and start claiming all variable names and value pairs
      // See paypal documentation for adjustments in these name value pairs as you need them
      var variables:URLVariables = new URLVariables();
      variables.cmd = "_xclick";
      // !!!! CHANGE LINE BELOW TO YOUR PAYPAL BUSINESS EMAIL ADDRESS !!!!
      variables.business = "zeeb@1776united.com"; // your merchant email at paypal
      variables.item_name = "New Revolution Small"; // Name of the product
      variables.item_number = "10001"; // Leave blank if item has no number
      variables.amount = "25.00"; // Set the price here
      variables.no_shipping = "2";
      variables.no_note = "1";
      variables.currency_code = "USD";
      variables.lc = "US";
      variables.bn = "PP-BuyNowBF";
      // Place all the variables above into a data packet of the URLRequest var
      payPal.data = variables;
      // Set the method to be 'POST' for sending the variables to paypal server
      payPal.method = URLRequestMethod.POST;

       

      // And finally we navigate to the PayPal Gateway Page for your biz
      navigateToURL(payPal, "_paypal"); // Same window method, no popup(recommended)

       

      }

       

      // Button Listener, set to run the function above when user clicks
      buyNowSmall_btn.addEventListener(MouseEvent.CLICK, buyNowDownSmall);