Hey, I need help with a really simple calculation between two different times.
Simple final time - intial time = difference between times.
I’m just starting out and having some real teething issues in working things out, all I get out is 0hours 0mins.
This is what I have:
function addTime (event:MouseEvent):void
{
var time1:Number;
var time2:Number;
var answer:int;
time1=Number(inputOne.text);
time2=Number(inputTwo.text);
answer=time2-time1;
inputThree.text = answer + 'Hours' + answer + 'Minutes';
}
myButton.addEventListener (MouseEvent.CLICK,addTime)
Thank you to anyone for any help, I just want to be able to get this working and wrap my head around it.