CarrotPay code
The following code is ALL that is required to add a payment to a flash file. See flash integration guide for more details.
#include 'flash_carrot.as' //CarrotPay's payment library
var feature:Object={launch_code:'lzprkjvl'}; //product name and launch code
var pay = new carrotpay('BWRV-JZHS-RQGZ-WLVL'); //create payment object
var return_url='http://www.flashgames.com?product=launch_code&auth=[launch_code]';
mouseListener.onMouseDown = function(){ //connect a payment to an event
pay.startPayment("'0.001','Moving Target',getReturnUrl('launch_code'));
}
//Once payment has been made pay.URL will be called with the processed url
//The auth parameter will be transformed into the launch code
//getParam() simply returns the named parameter from the url
pay.URL=function(url:String){
if(getParam(url,'auth')== feature[getParam(url,'product')])
fireWeapon(createEnemy()); //Start the action in the main game
}