Question about damping oscilation

hi every body
this is my 1st time to type in this facinating forum
i’m not profesional in AS , so i need any help to learn it
so … my problem is :
i want to make the oscilating motion with flash
general form of damping oscilation motion is
x=A*e^(-bt/2m)cos(w’+phy)
x : the displacement
A : the ampletude “max displacement”
e : ohiler’s No.
b,m : constantes
t : time
w’=(w^2-(bt/m)^2)^0.5
w=(k/m)^0.5
note: i use “^” as the power not XOR
so …
i open Flash … make 4 text types for A,b,m,and k … i condider phy=0
and opposite of these static texts i made 4 input texts and typed it its var
A,b,m and k , respectively
and insered a square movie clip named “spring”
then i go to the AS panel in frame 1 and typed this action:

 
 
w=Math.pow((k/m),0.5);
term=b/(2*m);
under=Math.pow(w,2)-Math.pow(term,2);
w_dash=Math.sqrt(under);
e=Math.E;
t= //the problem is in it 
pow_of_e=(-1*b*t)/(2*m);
x=A*Math.pow(e,poe_of_e)*Math.cos(w_dash);
 
spring.onMouseUp=function(){
spring._xscale += x ;
}

finally finish
tip:when i replaced the “x” in the last function with any No. then test the movie and click on the movie clip it become wider
but if i let it x no thing happen
whatever the value of t (eg. 100)
so i think Flash didn’t calculate the value of x

the 2nd problem that i want to make the value of t changed every second so that x will be positive then redueces to be zero and then negative
i don’t know how to tie the value of t with seconds :confused:

please help me :frowning: