Detecting mouse gestures in Flash with AS3 – Fixed

This is the reprise of an old post about detecting mouse gestures. Since I am making a quick game for my daughter using mouse (or finger gestures), I took the old algorithm and fixed a bug which prevented to correctly detect the up-right movement. Moreover, I optimized a bit the cde to avoid small movement detection.

This is the resut, draw something in the upper left sector:

The theory is fully explained in the original post, at the moment I am optimizing the code zooming the filtered mouse movement in order to achieve more precision when the user draws tiny lines.

This is the source code:

As always you can download the source code. Next time, optimized gesture detection, plus the capability of recognizing simple shapes.