ok I have the following actionscript that will include an external .php file and get me my variables that I want included into flash. But if i put all my php coding into the .php file say for instance index.php that runs the flash.swf movie then flash does not receive the variables from php. Only if the php is in a completely seperate document. Is there anyway of having the variable passed in the same document?
Basically I have an email sent to a user when they register. This has example: http://www.mysite.com/members/index.php?memid=10456
I want to pass the memid that is posted from their email to my flash file which in return has a form for paypal that will send their memid=10456 as the custom variable to paypal and back. How can I achieve this?
ACTIONSCRIPT CODING:
on (release) {
myData = new LoadVars();
myData.onLoad = function(){
placeTheDataIntoTheRightPlace();
};
myData.load("http://www.mywebsite.com/members/test.php"); // for external file I want same file that loads the .swf to get the memid for the user.
placeTheDataIntoTheRightPlace = function(){
custom.text = myData.customdata1;
//create the LoadVars that will hold our paypal information
var paypal = new LoadVars();
//specify the business, amount of the item, shipping, etc.
paypal.cmd="_xclick";
paypal.business=" ikonpr_1195618222_biz@gmail.com";
paypal.currency_code="USD";
paypal.amount="67.00";
paypal.item_name="The Book";
paypal.no_shipping="1";
paypal["return"]="http://www.mysite.com/purchase/success.php";
paypal.cancel_return=" http://www.mysite.com/purchase/cancel.php";
paypal.custom=myData.customdata1;
//send information to PayPal
paypal.send("https://www.sandbox.paypal.com/cgi-bin/webscr ","POST");
}
}