Accel and deccel

i made a code up for acceleration and decelleration or however you spell it.

is this the right code for it because i dont think it is:

onClipEvent (load) {
left = 0;
right = 0;
up = 0;
down = 0;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
right++;
_x += right;
}
if (!Key.isDown(Key.RIGHT)) {
if (right>0) {
right–;
_x += right;
}
}
///////////////////////////
if (Key.isDown(Key.LEFT)) {
left–;
_x += left;
}
if (!Key.isDown(Key.LEFT)) {
if (left<0) {
left++;
_x += left;
}
}
///////////////////////////
if (Key.isDown(Key.UP)) {
up–;
_y += up;
}
if (!Key.isDown(Key.UP)) {
if (up<0) {
up++;
_y += up;
}
}
///////////////////////////
if (Key.isDown(Key.DOWN)) {
down++;
_y += down;
}
if (!Key.isDown(Key.DOWN)) {
if (down>0) {
down–;
_y += down;
}
}
//////////////////////////
if (_x>550) {
_x = 0;
}
if (_x<0) {
_x = 550;
}
if(_y<0){
_y=400
}
if(_y>400){
_y=0
}
}