hello,
im trying to make a little application that lets users select a certain
quantity of several products and then calculates the total cost
so i have 2 columns each time the quantity and price of the product
when i click the calculate button i needs to multiply the qty with the price
for each product and then add the total prices for each product
however i always get NaN in the dynamic textfield when i click the calculate button
the code:
var esoplayer = 300;
var sony = 425;
var iriver = 195;
var philipscd = 168;
//de intitiƫle waarden (0) worden gedefinieerd voor qty1, qty2,..
qty1_txt.text = 0;
qty2_txt.text = 0;
qty3_txt.text = 0;
var listener:Object = new Object();
listener.click;
listener.click = function() {
total_txt.text = (Number(esoplayer)*Number(qty1_txt.text))+
(Number(sony)*Number(qty2_txt.text))+
(Number(iriver)*Number(qty3_txt.text))+
(Number(philipscd)*Number(qty4_txt.text));
};
calculate.addEventListener("click", listener);