Im probably making this harder that what it is…:crying:
I have an equation that needs to calculate variables as it receives them and output the value to a dynamic text field. I have successfully created a function passed values to it but after the first calculation it wont do anything else.
Here is my code:
//setup my variables to wait for values
var child1:Number = new Number();
var child2:Number = new Number();
var child3:Number = new Number();
onEnterFrame = function(){
function calcKids(child1, child2, child3) {
var totalvalue:Number = child1+child2+child3; //calculate all of the children
number_output.text = totalvalue; //output to my textfield
}
//Actions on my button
kid1.onPress = function(){
calcKids(100,0,0);
}
kid2.onPress = function(){
calcKids(0,100,0);
}
kid3.onPress = function(){
calcKids(0,0,100);
}
the totalvalue should read 300 but it stays at 100 .
Any help would be greatly appreciated…