Hello All,
I am trying to create an array of purchases or objects. I have several products that I want to store the users selection to contain the item they selected, price, & quantity. I’m at a loss on how to set this up. Currently the user can select their product and their total price will be displayed in the Cart Total text field but I have no way of storing the data. Thanks in advance.
Here is my code in .as file
import mx.controls.*;
import fl.controls.dataGridClasses.*;
import fl.controls.dataGridClasses.DataGridColumn;
import fl.data.DataProvider;
class Cart2 {
var CartCalc:String;
var quantity:NumericStepper;
var Product:Number;
var mynum:String;
var CartTotal:Number = 0;
var CartTotal2:Number = 0;
var CalcMe:Number;
var Total:Number = 0;
var MyArray:Array;
var m_parent_mc:MovieClip;
var GiftCardsText:String;
var PostersText:String;
public function GetUserSelection() {
var quantity = _level0.TESTMC.myvalue.value;
Product = 5.00;
GiftCardsText="Gift Cards";
var CalculateValue = (Product*quantity*100)/100;
drawCartTotal(CalculateValue);
}
public function GetU() {
var quantity = _level0.TESTMC.myvalue2.value;
Product = 10.00;
PostersText="Post Cards"
CalcMe = (Product*quantity*100)/100;
drawCartTotal(CalcMe);
}
function drawCartTotal(MyTotal:Number) {
Total += MyTotal;
_level0.CartTotal = String(Total);
_level0.CartTotal.indexOf(".") == -1 ? _level0.CartTotal += ".00" : _level0.CartTotal += "0";
}
}