As 2 to as 3

hello,,I have a trouble,, I want to make an interactive media simulation,,in as 2 I can, but to change the script in as 3 I don't know,,could you help me please to change this script into as3
Frame 1
var x0:Number;
var v0:Number;
var a:Number;
var t: Number;
var s:Number;
var t_travel:Number;
var t_base:Number;
function inisialitation(){
                car._x = 0;
                x0=car._x;
                s=0;
                v0=0;
                vt=v0;
                a=0;
                t=0;
                t_travel=0;
                delta=0.1;
inisialitation();
stop();
Frame 2
if(t<=t_travel){
                car._x = x0+v0*t+(1/2)*a*t*t;
                vt=v0+a*t;
                s= car._x-x0;
}else{
                s= v0*t_travel+(1/2)*a*t_travel*t_travel;
                vt = v0+a*t_travel;
                stop();
Frame 3
t=t+delta;
gotoAndPlay(2);
thanks for your attention

thank u sir,,this is the picture of my simulatation,,if we input number in (v0),(a) and (t), and then press the play button,,automatically the value of ( x ) will appear and the car will move to right. on the above is the action script in AS 2,,can u change into AS 3 sir ??

Similar Messages

Maybe you are looking for