Paypal: Buy Now Button problem in Flash MX

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Paypal: Buy Now Button problem in Flash MX
freeky_bonjela
CZ Newbie
freeky_bonjela has been a member for over 19 year's 19 Year Member
uk.gif
Age: 48
Gender: Male
Status: Offline
Joined: Jan 11, 2005
0.00 posts per day
Posts: 6
Points: 60
   
I am trying to create a button in flash which when clicked allows the buyer to purchase a bands CD, but has one cost for UK residents and another for elsewhere.
So far i have the button working so that it will charge one set fee and i have coded the flash button as follows:

on (release) {
getURL("www.oosterdok.com&cancel_return=http%3A//www.oosterdok.com&no_note=1¤cy_code=GBP" target="_blank">https://www.paypal.com/xclick/business=info%40brownhouserecords.com&undefined_quantity=1&item_name=Some+day+we+will+part+forever+%28EP%29&item_number=BHR00001&amount=4.00&page_style=PayPal&no_shipping=2&return=http%3A//www.oosterdok.com&cancel_return=http%3A//www.oosterdok.com&no_note=1¤cy_code=GBP");
}

any ideas how to add a drop down so that the user can choose UK or Rest of World which updates the price from £4 to £5 accordingly

thanx



Back to top Reply with quote
#2   re: Paypal: Buy Now Button problem in Flash MX
bpat1434
CZ Newbie
bpat1434 has been a member for over 19 year's 19 Year Member
usa.gif maryland.gif
Occupation: EMT, Community Assistant, Webmaster, Firefighter, Web Host
Age: 40
Gender: Male
Website:
Status: Offline
Joined: Jan 19, 2005
0.00 posts per day
Posts: 21
Points: 783
AIM Address Yahoo Messenger MSN Messenger 
You've answered your own question and you don't even know it.

Add a drop-down component to the screen. Give it an instance name of "country" (without quotes). Then, all you do is call a listener object. So, your flash should be set up like:


Frame 2
Actions Layer (Layer 1)
stop;
choice = new Object();
choice.change = function(){
   $price = country.selectedItem.data;
   $country = country.selectedItem.label;
   cntry.text = $country;
   prce.text = $price;
   test.text = "https://www.paypal.com/xclick/business=info%40brownhouserecords.com&undefined_quantity=1&item_name=Some+day+we+will+part+forever+%28EP%29&item_number=BHR00001&amount="+$price+"&page_style=PayPal&no_shipping=2&return=http%3A//www.oosterdok.com&cancel_return=http%3A//www.oosterdok.com&no_note=1¤cy_code=GBP"
}
country.addEventListener("change", choice);

purchase.onRelease = function(){
   getURL("https://www.paypal.com/xclick/business=info%40brownhouserecords.com&undefined_quantity=1&item_name=Some+day+we+will+part+forever+%28EP%29&item_number=BHR00001&amount="+$price+"&page_style=PayPal&no_shipping=2&return=http%3A//www.oosterdok.com&cancel_return=http%3A//www.oosterdok.com&no_note=1¤cy_code=GBP");
}


Frame 1
Object Layer (Layer 2)
You will have:
ComboBox (id as: country)
Dynamic Text Field (id as: cntry)
Dynamic Text Field (id as: prce)
Button (id as: purchase)

I'm not sure what the other junk in the getURL was, but you can see how I edited it to suit my needs.

***** This gives me an error when following the link. Some characters are not correct for some odd reason *****
If you remove the &return= from the link, it works 100%!!

I have attached the movie as a test, and uploaded the FLA to my site.

[ Register or login to view links on this board.]
[ Register or login to view links on this board.]

~Brett


Back to top Reply with quote
#3   re: Paypal: Buy Now Button problem in Flash MX
freeky_bonjela
CZ Newbie
freeky_bonjela has been a member for over 19 year's 19 Year Member
uk.gif
Age: 48
Gender: Male
Status: Offline
Joined: Jan 11, 2005
0.00 posts per day
Posts: 6
Points: 60
   
Thanks Brett,

however since my post after much playing around i have been able to get it to work using the paypal snap-ins.
I did download your fla file to learn from it though, but it wouldn't open. I have flash MX do you have a different version?
have a look at the 'finished' website....although you probably already have seeing as you had my code! [ Register or login to view links on this board. ]
they have some great music - check it out

thanks again

iAN



Back to top Reply with quote
#4   re: Paypal: Buy Now Button problem in Flash MX
bpat1434
CZ Newbie
bpat1434 has been a member for over 19 year's 19 Year Member
usa.gif maryland.gif
Occupation: EMT, Community Assistant, Webmaster, Firefighter, Web Host
Age: 40
Gender: Male
Website:
Status: Offline
Joined: Jan 19, 2005
0.00 posts per day
Posts: 21
Points: 783
AIM Address Yahoo Messenger MSN Messenger 
SOrry. I was using Flash MX 2004, but still it should not have had a problem opening it.

Oh well. Glad to hear you got it working.

~Brett



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum