Super-accurate hitTest

Hi there

Point hitTest provides an accurate system. However, using point hitTest still allows objects to penetrate some impassable objects such as walls in a game. How to measure the shortest distance between an irregular boundary and a point?

Thanks