Hi none800,
Unfortunately, there is no pure Flash Lite API to detect that whether your flash content is in background or foreground. But there is a solution to your problem
. Simply, use setInterval API instead of getTimer because according to my observation, setInterval get paused once your application is sent to back and get start from the same position where u left it. So, in that case ,the user cant cheat. As this is my 1000th post, you are getting a code tip as bonus
:
Code:
//AS 2
_global.mytimer = 0;
function callback() {
_global.mytimer ++;
_stat.text = _global.mytimer ;
}
var intervalID:Number = setInterval(callback, 1000);
Best Regards,
SajiSoft