This flash-compatible extension written for Jacob allows you to calculate the 'cost' it needs to reach a certain tile on a map from the position of another tile. Each tile of the map has its own cost. This basically allows you to create games like Advance Wars where the player is able to move a certain amount of steps but can't walk as much on terrain like forest, mountain, etc.
Comes with examples and help file.
Example of an Advance Wars-like movement in Flash: