[HELP]How to detect no mouse movement & keyboard activity and do something

Hi guys,

I’m looking for some help with an AS3 script that detect if the mouse has no movement for 1min +no keyboard activity, it will call a function to change the frame in TimeLine.

Any ideas please?