Need help with _x distance of a movieclip

Hey guys,
I’m currently developing my next game and I have some difficulties about the ._x distance of a movieclip. I’m sorry but I’m not good at explaining this things so I attached a picture below, hope you understand better. :smirk:

Basically the line is representing the distance which the hero is located currently. The little red ball from the bottom is the main player, and I want it to move horizontally depending on the ‘distance’ value. The lowest value that ‘distance’ can be is 0 and the highest is 5000. (the final boss is located at 5000)
e.q. if ‘distance’ value is currently 2165, then the red ball will depend on this value and be located on the line at 2165…

I expect the code to be placed in the red ball movieclip actions, something like this._x=_root.distance, this would just move the red ball at 2165 pixels on the stage (if ‘distance’ was 2165)…

I would really appreciate if someone could help me out :*(
Thanks!
(Sorry for my bad English)