Solved! Go to Solution.
import mx.managers.SystemManager; import mx.events.FlexEvent; import mx.core.mx_internal; use namespace mx_internal;
systemManager.addEventListener(FlexEvent.IDLE, userIdle);
private function userIdle(e:FlexEvent):void { if(e.currentTarget.mx_internal::idleCounter == 9000){ // 15 mins Elapsed while Being Idle!! // do something when the application has been idle for 15 mins navigateToURL(new URLRequest('http://www.this url works for me because it redirects the user to the login page/index.html'), '_self'); } }
<script type="text/javascript"> var xScroll, yScroll, timerPoll, timerRedirect; function initRedirect(){ if (typeof document.body.scrollTop != "undefined"){ //IE,NS7,Moz xScroll = document.body.scrollLeft; yScroll = document.body.scrollTop; clearInterval(timerPoll); //stop polling scroll move clearInterval(timerRedirect); //stop timed redirect timerPoll = setInterval("pollActivity()",1); //poll scrolling timerRedirect = setInterval("location.href='www.google.com'",1200000); //set timed redirect } else if (typeof window.pageYOffset != "undefined"){ //other browsers that support pageYOffset/pageXOffset instead xScroll = window.pageXOffset; yScroll = window.pageYOffset; clearInterval(timerPoll); //stop polling scroll move clearInterval(timerRedirect); //stop timed redirect timerPoll = setInterval("pollActivity()",1); //poll scrolling timerRedirect = setInterval("location.href='www.google.com'",1200000); //set timed redirect } //else do nothing } function pollActivity(){ if ((typeof document.body.scrollTop != "undefined" && (xScroll!=document.body.scrollLeft || yScroll!=document.body.scrollTop)) //IE/NS7/Moz || (typeof window.pageYOffset != "undefined" && (xScroll!=window.pageXOffset || yScroll!=window.pageYOffset))) { //other browsers initRedirect(); //reset polling scroll position } } document.onmousemove=initRedirect; document.onclick=initRedirect; document.onkeydown=initRedirect; window.onload=initRedirect; window.onresize=initRedirect; </script>
import mx.managers.SystemManager; import mx.events.FlexEvent; import mx.core.mx_internal; use namespace mx_internal;
systemManager.addEventListener(FlexEvent.IDLE, userIdle);
private function userIdle(e:FlexEvent):void { if(e.currentTarget.mx_internal::idleCounter == 9000){ // 15 mins Elapsed while Being Idle!! // do something when the application has been idle for 15 mins navigateToURL(new URLRequest('http://www.this url works for me because it redirects the user to the login page/index.html'), '_self'); } }