var minX:Number = 200; var maxX:Number = 400; var accX:Number = 1; ----- if (_x > maxX) accX = -1; if (_x < minX) accX = 1; _x += accX;