A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Paypal Buy it Now AS2 help

  1. #1
    Join Date
    Jun 2006

    Paypal Buy it Now AS2 help

    I've a few question. Before making my flash paypal buy it now button, do I have to make the actual button (for an item I want to sell) on the paypal website itself first so the flash button connects to it?

    Second, I'd like to have it coded in AS2 if possible. I found this AS3 version, I have no problem using it if I must (just change my shop.swf to be AS3) which I hope doesn't break some functionality...

    Here's the code, but my question about it is that I want my shipping to be $3.50, so would I change no_shipping = "2" to shipping = "3.50" ?

    Item Number.. where would I get one?

    Thanks for your patience

    function buyNowDown(event:MouseEvent):void { 
     var url:String = "https://www.paypal.com/cgi-bin/webscr";
     var payPal:URLRequest = new URLRequest(url);
     var variables:URLVariables = new URLVariables();
     variables.cmd = "_xclick";
     variables.business = "me@mysite.com";
     variables.item_name = "product name";
     variables.item_number = "123456";
     variables.amount = "10.00";
     variables.no_shipping = "2"; 
     variables.no_note = "1";
     variables.currency_code = "USD";
     variables.lc = "US";
     variables.bn = "PP-BuyNowBF"; 
     payPal.data = variables;
     payPal.method = URLRequestMethod.POST;
     navigateToURL(payPal, "_self"); // Same window method, no popup(recommended)
     buyNow_btn.addEventListener(MouseEvent.CLICK, buyNowDown);

  2. #2
    Join Date
    Jun 2006
    I found it but I still have 1 last question (I got the following code from a dead link through archive org where links today were dead).

    What you see below is ActionScript2, tested and working.. My question is, am I able to add a "stock number"? (how many of that product that is available). What might the var string be?

    var cmd:String = "_xclick";
    var business:String = "paypal email here";
    var item_name:String = "product name";
    var item_number:String = "make your own product number or leave blank";
    var amount:String = "price";
    var shipping:String = "shipping price";
    var no_note:String = "1";
    var currency_code:String = "USD";
    var lc:String = "US";
    var bn:String = "PP-BuyNowBF";
    buynow_btn.onRelease = function() {
    	getURL("https://www.paypal.com/cgi-bin/webscr", "_blank", "POST");

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