I have a flash page that i want to foward to paypal for the user topurchase the items, what i did is ceated 3 functions(1 for if they buy the basic model,another for if they buy the advanced,and another for if they buy both) the problem is none of the functions works at all and i cant figure out why.
on (release) {
//////////////Basic Model /////////////////////////////
sendBasic = function () {
// Code to send them to paypal
var paypal = new LoadVars();
paypal["cmd"] = "_xclick";
paypal["business"] = [EMAIL="xx@xx.com"]xx@xx.com[/EMAIL];
paypal["item_name"] = " Basic Model";
paypal["amount"] = "79.99";
paypal["quantity"] = BasicQ;
paypal["no_shipping"] = "2";
paypal["shipping"] = "15.00";
paypal["no_note"] = "1";
paypal["currency_code"] = "USD";
paypal["lc"] = "US";
paypal["bn"] = "PP-BuyNowBF";
paypal.send("https://www.paypal.com/cgi-bin/webscr", "post");
};
///////////////////////////////////////////////////////
//////////////Advance Model /////////////////////////////
sendAdv = function () {
// Code to send them to paypal
var paypal = new LoadVars();
paypal["cmd"] = "_xclick";
paypal["business"] = [EMAIL="xx@xx.com"]xx@xx.com[/EMAIL];
paypal["item_name"] = " Advanced Model";
paypal["amount"] = "89.99";
paypal["quantity"] = AdvQ;
paypal["no_shipping"] = "2";
paypal["shipping"] = "15.00";
paypal["no_note"] = "1";
paypal["currency_code"] = "USD";
paypal["lc"] = "US";
paypal["bn"] = "PP-BuyNowBF";
paypal.send("https://www.paypal.com/cgi-bin/webscr", "post");
};
///////////////////////////////////////////////////////
////////////////Basic & Advance////////////////////////
send2 = function () {
// Code to send them to paypal
var paypal = new LoadVars();
paypal["cmd"] = "_cart";
paypal["upload"] = "1";
paypal["business"] = [EMAIL="xx@xx.com"]xx@xx.com[/EMAIL];
// Basic Model
paypal["item_name_1"] = " Basic Model";
paypal["amount_1"] = "79.99";
paypal["quantity_1"] = BasicQ;
// Advance Model
paypal["quantity_2"] = AdvQ;
paypal["item_name_2"] = "Advance Model";
//paypal["item_number_2"] = "1OneTimeTAB";
paypal["amount_2"] = "89.99";
paypal["no_shipping"] = "2";
paypal["shipping"] = "15.00";
paypal["no_note"] = "1";
paypal["currency_code"] = "USD";
// paypal["lc"] = "US";
// paypal["bn"] = "PP-BuyNowBF";
paypal.send("https://www.paypal.com/cgi-bin/webscr", "post");
};
////////////////////////////////////////////////////////
BasicQ = bt.text;
AdvQ = at.text;
//No Data Entered
if (BasicQ == "0" && AdvQ == "0") {
trace("Please Make All Selections Before Continuing");
pe = "**Please Make All Selections Before Continuing**";
AdvQ = "0";
BasicQ = "0";
stop();
}
//Only Basic
if (BasicQ != "0" && AdvQ == "0") {
sendBasic();
}
// Only Advance
if (BasicQ = "0" && AdvQ != "0") {
sendAdv();
}
//If Both Adv and Basic are bought X
if (BasicQ != "0" && AdvQ != "0") {
send2();
}
}