Timed mouse disappear

I’m completely stuck with a problem;
I want to hide the mouse after some period when there is no mouse movement (i.e. 5 seconds), and then for the mouse to reappear when the user moves their mouse again.

Does anyone know how to code this is AS3?

Thanks in advance