It will work on a moving object.
Mouse.X-Sprite.X gives you the x position relative to the Sprite, same for the y.
With the hotspot of the sprite set to "top left" you will get values between 0-50 for x and y.
If all you want is the direction from the mouse to the center of the Sprite then you can use the angle() expression to get the angle:
angle(Mouse.X, Mouse.Y, Sprite.X, Sprite.Y)
With the physics behavior the angle expression isn't even needed as you can apply impulse toward a position.
http://dl.dropbox.com/u/5426011/examples%208/kick.capx