Flash/Paypal integration (2 questions)

Hi there,
I’m a newbie here and a newbie to Flash CS3 and ActionScript. I’m trying to get my paypal ‘add to cart’ and ‘view cart’ buttons to work on my Flash site. My ‘view cart’ button seems to work (at least it goes to the correct page), but every time I go to view cart, it’s always empty. So that must mean that my ‘add to cart’ button isn’t working, right?

I’ve scoured the forums and googled the heck out of this topic. I’ve tried all the different variations of codes I could find and I’m still not sure what I’m doing wrong.

So this is what I currently have on my ‘view cart’ button (though it seems to be working, please tell me if I’m missing anything in this script):


on (release) {

      var lv = new LoadVars();
      lv.cmd="_cart";
      lv.business="me@email.com";
      lv.display="1";
 lv.send("https://www.paypal.com/cgi-bin/webscr","_blank","paypal","POST");
}

For the ‘add to cart’ button, this is what I currently have as the actionscript in the frame where my button is (which is not working):

 this.buyNow_btn.onPress = function () {     
lv=new LoadVars();
lv.cmd="_cart";
lv.business="me@email.com";
lv.item_name="Lahdidah";
lv.item_number="12345";
lv.amount="100.00";
lv.shipping="0.00";
lv.page_style="Primary";
lv.no_shipping="1";
lv.thank_return="http://www.mysite.com/thankyou.html";
lv.cancel_return="http://www.mysite.com/cancel.html";
lv.currency_code="USD";
lv.lc="US";
lv.bn="PP-ShopCartBF";     
lv.send("https://www.paypal.com/cgi-bin/webscr", paypal, "POST"); 
}

And for the actual button action, I have:

 on(release) {
getURL("https://www.paypal.com/cgi-bin/webscr", _paypal);
}

So am I way off here? I’m confused about where to put the script (in the frame or as a button action) so I’ve tried every combo you could think of with all the various scripts I’ve read about in this and other forums and tutorials. Nothing is working properly. As far as I know, I’m using AS2.0.

ALSO, I just realized another issue. Since my items are one-of-a-kind items, is there a way that I can cap the purchases at one so that once an item has been purchased, no one else can buy it? I don’t want multiple people trying to buy the same item when I only have one available. Please tell me there’s a way around this. crossing my fingers

PLEASE HELP!!! I’m going out of my mind. :crazy:

Thanks in advance!