Codice PHP:
speedX = 0;
speedY = 0;
punt._y = 400;
punt._x = 550;
System.useCodepage = true;
MyLoadVars = new LoadVars();
MyLoadVars.path = this;
this.MyLoadVars.load("testo.txt");
MyLoadVars.onLoad = function(success) {
if (success) {
test1 = this.ordinate;
test2 = this.ascisse;
speedY = (400-test1)/50;
speedX = (550-test2)/50;
}
punt.onEnterFrame = function():Void {
while ((punt._y != test1) and (punt._x != test2)) {
punt._x -= speedX;
punt._y -= speedY;
trace(punt._x);
trace(punt._y);
}
delete this.onEnterFrame;
};
};
MyLoadVars.load("testo.txt");