# Text Box Value and Timer

**URL:** <https://forum.kirupa.com/t/text-box-value-and-timer/316768>\
**Category:** flash\
**Created:** [December 2, 2010, 1:56am UTC](https://forum.kirupa.com/t/text-box-value-and-timer/316768 "2010-12-02T01:56:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![na\_il](https://avatars.discourse-cdn.com/v4/letter/n/bc79bd/32.png) [@na\_il](https://forum.kirupa.com/u/na_il)\
**Post date:** [December 2, 2010, 1:56am UTC](https://forum.kirupa.com/t/text-box-value-and-timer/316768/1 "2010-12-02T01:56:17Z")

</div>

var txt\_1 = txt2.text;  
var txt\_2 = txt3.text;  
txt4.text = (txt\_2 - txt\_1);

What is the alternative way of doing this??? Seeing the text in the txt boxes are numbers correlative to a timer constantly going. Here is the rest of the code:  
var timer2:Timer = new Timer(1);//create the timer  
var txt\_1 = txt2.text;  
var txt\_2 = txt3.text;  
txt4.text = (txt\_2 - txt\_1);  
//var i:Number = .5;

timer2.addEventListener(TimerEvent.TIMER, doNextTween2);

function doNextTween2(event:TimerEvent):void{  
var startTime = getTimer();  
txt.text = (startTime);

// //if ( btn.height \>= 95)  
//{  
// timer2.removeEventListener(TimerEvent.TIMER, doNextTween2);  
//}

}  
btn.addEventListener(MouseEvent.MOUSE\_OVER, doNextTween);

function doNextTween(evtObj:MouseEvent):void{  
timer2.start();  
var cool = getTimer();  
txt2.text = cool;

}

btn.addEventListener(MouseEvent.MOUSE\_OUT, doNextTween1);

function doNextTween1(evtObj:MouseEvent){  
var cool2 = getTimer();  
txt3.text = cool2;  
timer2.stop();

}

I’m basically trying to record the time the mouse is over a movie clip, and I need it to be as accurate as possible, so to the nearest millisecond.
