Just got bored and decided to play around with GS3.
It's really quite simple, but it works effectively.
PHP Code:
//#GS3
//#CLIENTSIDE
var op:number;
function onCreated():void{
op = {player.x, player.y, player.level};
this.onTimeout();
}
function onTimeout():void{
//Check the distance between the players last position
//and their current position.
var d:number = this.Dist(op[0], player.x, op[1], player.y);
//d is the distance traveled in the last second
//if(player.level == op[2] && d > 30){
//Set the old position
op = {player.x, player.y, player.level};
this.settimer(1);
}
//Pythagoras, get the distance between two points
function Dist(x1:number, x2:number, y1:number, y2:number):number{
return (((x1-x2)^2)+((y1-y2)^2))^0.5;
}