MMO-game : PHP vs AS2

Ive been working on a virtual chat-room where you walk around with your avatar.

After having created a class (in AS2) that takes care of the creation of all the avatars, I also included the code for how they should navigate.

Since it is a click-n-walk type of game, this navigation-code becomes pretty big.

But now I figure I should probably have coded a navigation-function in PHP instead, that all the different avatars can call.

What course do you take when implementing the navigation-code in a MMO? What parts should be programmed in AS, and what parts should be programmed in PHP?