Cheska
05-29-2006, 02:26 PM
HI,
I am using Flash MX 2004 on the mac platform.
A while backcI found the following code that enabled me to set up paypal donatoins from my flash site. It was after searching through a huge amount of complicated code and help forum ideas that I eventually found what turned out to be incredibly simple (in my opinion). I have a button on the stage called button1 , and I place the following code in the first frame of my main timeline.
stop();
function makeDonation1() {
var lv : LoadVars = new LoadVars();
lv.cmd = "_xclick";
lv.business = "me@mydomain.com";
lv.item_name = "monkey";
lv.item_number = "monkey01";
lv.no_note = 1;
lv.currency_code = "USD";
lv.tax = 0;
lv.lc = "US";
lv.send("https://www.paypal.com/cgi-bin/webscr", "POST");
}
Button1.addEventListener("click", makeDonation1);
I'm definitely not a coder and understand actionscript only just enough to get through each project - no matter how much I try at this point however, most knowledge slips through the seive in my brain by the time it comes to use that knowledge again - grrrr.
What I am trying to do is two things.
1. Convert the above code to an add to cart button. (I know that the donation code above might have to change to different variables for an add-to-cart button, but I'm not sure what they are or which ar erequired by paypal at the very least.)
2. have the item name, item reference & price be determined by the value of a combobox selection. (download link to my fla below to understand better).
I have never used comboxes before, and my first challenge is figuring out how to make a combobox user selection change the value of a variable (or three variables in this instance - item name /item ref/item cost). How do I do this???? surely there is not much other use for a combobox than to change the values of variables but I can't find any simple info on this online! Is the 'data' where i put the variable value??? how do i refer to this elsewhere?? woudl it be:
myvariable1 = combobox1.data
(Total guess - no idea if that's even valid code or if the data is where I would get the value from)
I will try to figure this out by myself, but if anyone can help me out I'd be really grateful,
Thanks in advance
Cheska
PS) here is a link to download my zipped FLA ( I haven't added any code yet for the three variables relating to the combobox choices - because I don't know how !) http://www.lucid-life.com/paypaltest.fla.zip
I am using Flash MX 2004 on the mac platform.
A while backcI found the following code that enabled me to set up paypal donatoins from my flash site. It was after searching through a huge amount of complicated code and help forum ideas that I eventually found what turned out to be incredibly simple (in my opinion). I have a button on the stage called button1 , and I place the following code in the first frame of my main timeline.
stop();
function makeDonation1() {
var lv : LoadVars = new LoadVars();
lv.cmd = "_xclick";
lv.business = "me@mydomain.com";
lv.item_name = "monkey";
lv.item_number = "monkey01";
lv.no_note = 1;
lv.currency_code = "USD";
lv.tax = 0;
lv.lc = "US";
lv.send("https://www.paypal.com/cgi-bin/webscr", "POST");
}
Button1.addEventListener("click", makeDonation1);
I'm definitely not a coder and understand actionscript only just enough to get through each project - no matter how much I try at this point however, most knowledge slips through the seive in my brain by the time it comes to use that knowledge again - grrrr.
What I am trying to do is two things.
1. Convert the above code to an add to cart button. (I know that the donation code above might have to change to different variables for an add-to-cart button, but I'm not sure what they are or which ar erequired by paypal at the very least.)
2. have the item name, item reference & price be determined by the value of a combobox selection. (download link to my fla below to understand better).
I have never used comboxes before, and my first challenge is figuring out how to make a combobox user selection change the value of a variable (or three variables in this instance - item name /item ref/item cost). How do I do this???? surely there is not much other use for a combobox than to change the values of variables but I can't find any simple info on this online! Is the 'data' where i put the variable value??? how do i refer to this elsewhere?? woudl it be:
myvariable1 = combobox1.data
(Total guess - no idea if that's even valid code or if the data is where I would get the value from)
I will try to figure this out by myself, but if anyone can help me out I'd be really grateful,
Thanks in advance
Cheska
PS) here is a link to download my zipped FLA ( I haven't added any code yet for the three variables relating to the combobox choices - because I don't know how !) http://www.lucid-life.com/paypaltest.fla.zip