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:

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.


looking a little deeper, it seems there's even a graphical path editor: