onClipEvent(load){
    friction = .7;
    speedratio = .3;
    speed = 0;
    goal = 500;
}

onClipEvent(enterFrame){
    speed = speed * friction + (goal - _x) *
speedratio;
    _x += speed;
}