最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

flex SystemManger監(jiān)控用戶是否和程序打交道

 更新時間:2009年05月25日 18:44:18   作者:  
flex中可以通過SystemManger監(jiān)控用戶是否和程序打交道
例如:
var sysMan:SystemManager = Application.application.systemManager;
sysMan.removeEventListener(FlexEvent.IDLE, timeoutHandler);
// timeout after twenty seconds
public var timeout:Number = 20000;
private var timeoutTotal:Number = 0;
private var timeoutLastCall:Number;
public var sessionExpired:Boolean = false;
public var enableTimeout:Boolean = true;
private function timeoutHandler(event:FlexEvent):void
{
// get current time
var curTime:int = getTimer();
var timeDiff:int = 0;
if (isNaN(timeoutLastCall)) {
timeoutLastCall = curTime;
}
timeDiff = curTime - timeoutLastCall;
timeoutLastCall = curTime;
// if time has passed since the idle event we assume user is interacting
// reset time total - otherwise increment total idle time
if (timeDiff > 1000) {
timeoutTotal = 0;
}
else {
// update time
// the status field will not be updated unless the application is idle
// it is only display a countdown for learning purposes
timeoutTotal += 100;
status.text = "Timeout in " + String(Number((timeout - timeoutTotal)/1000).toFixed(0)) + " seconds";
}
// if the total time of inactivity passes our timeout
// and the session already hasn't expired then logout user
if (timeoutTotal > timeout && !sessionExpired) {
// logout user
// or set flag
sessionExpired = true;
status.text = "timeout threshold has been reached";
//當時間超過之后執(zhí)行的語句
sessionTimeoutHandler();
}
}

相關(guān)文章

最新評論

彭泽县| 威远县| 会东县| 商丘市| 自贡市| 文登市| 丰镇市| 晋宁县| 壶关县| 灌南县| 长春市| 岳池县| 沈阳市| 伊宁市| 鹤山市| 嵊泗县| 通道| 米脂县| 沁源县| 祁阳县| 南丹县| 固安县| 唐海县| 平潭县| 克什克腾旗| 临泉县| 呼伦贝尔市| 健康| 类乌齐县| 龙岩市| 织金县| 连城县| 乳山市| 军事| 丰台区| 登封市| 娱乐| 宜兰县| 屯昌县| 定边县| 谷城县|