Greating unbalanced

Hi everyone

Im trying to create a game with a drunk effect where by the user controls an object along the x axis

the object of the game is to keep the object balanced as long as possible

how i aim to do this is increment and decrease the _x axis randomly thus achieving the drunk effect and the user has to counter act the drunkness and keep the object as “stable” as possible

i found some code on another forum from a guy that was trying to do the same thing but it doesnt seem to work at all


onClipEvent (enterFrame) {
     mouse_x = _root._xmouse;
     circle_x= this._x;
     dist = mouse_x - circle_x;//if the xmouse position is greater than the
//circle's position dist will be a positive number, therefore the circle will move
//closer to the mouse (by moving right)
//if the xmouse position is less than the circle position dist will be a negative number,  (by moving left)
          circle._x += (0.1 * dist);
}

when i applied this code it didnt do anything at all

any help on this would bereally appericated