An implementation of Hierarchical State Machine in ActionScript 3.0 for AI bot/agent in a video games