Player walk in a certain path

I want to make a movement that player can walks only some specific places, some thing like this: First the movement of the player is normal(he moves depending the camera rotation something like Splinter Cells games) and I want that when the player enters to a points that are making a cube the player can only walk in that certain path.

Another example of this application: suppose that I have a wall and the player climbs the wall or tube like here at 2:48, as you can see the player can only move on a certain path, but remember that my movement depends on the camera so please don't put a question saying that block forward and backward movement, so my question is how can I do this?

Note: JavaScript please

Though i haven't tried it myself, from what I understand, this is the kind of thing iTween excels at. Check out the MoveTo function here:

http://itween.pixelplacement.com/documentation.php#MoveTo

If you set your character to enter into a set animation once it hits some sort of trigger, it seems to me this solution could work.

EDIT:

looking a little deeper, it seems there's even a graphical path editor: http://pixelplacement.com/2010/12/03/visual-editor-for-itween-motion-paths/