Quelqu'un peut'il m'expliquer pourquoi ce code fonctionne sous flash 6 et pas sous Flash 7.
onClipEvent (enterFrame) {
thrust = 1;
decay = .98;
maxSpeed = 15;
if (Key.isDown(Key.UP)) {
xSpeed += thrust*xThrustPercent;
ySpeed += thrust*yThrustPercent;
} else {
xSpeed *= decay;
ySpeed *= decay;
}
//
if (Key.isDown(Key.RIGHT)) {
_rotation += 10;
}
//
if (Key.isDown(Key.LEFT)) {
_rotation -= 10;
}
xThrustPercent = Math.sin(_rotation*(Math.PI/180));
yThrustPercent = Math.cos(_rotation*(Math.PI/180));
//
speed = Math.sqrt((xSpeed*xSpeed)+(ySpeed*ySpeed));
if (speed>maxSpeed) {
xSpeed *= maxSpeed/speed;
ySpeed *= maxSpeed/speed;
}
//
_y -= ySpeed;
_x += xSpeed;
}