Why isnt this working?

ok so im stuck here with the magnet thing again if you read my last post, but i cant even get a block to move…can someone tell me what i am doing wrong? here is the AS

onClipEvent (enterFrame) {
    if (_root.car.x == 505) {
        _root.car.x = 165
    }
}

onClipEvent (enterFrame) {
    _x += xspeed 
    _y += yspeed
    
}
onClipEvent (enterFrame) {
    xspeed += 4
    yspeed += 0
}