スプライトを中心点を中心に回転させるアクション スクリプトをオンラインで見つけましたが、使用すると 2 つのエラーが発生します。1084: 構文エラー: 左括弧の前に識別子が必要です。1084: 構文エラー: 左括弧の前に右括弧が必要です。 また、angleDegreesの代わりに、スプライトを回転させたい角度を入れますか?
var point:Point=new Point(spr_box.x+spr_box.width/2, spr_box.y+spr_box.height/2);
rotateAroundCenter(spr_box,45);
function rotateAroundCenter (ob:*, angleDegrees) {
var m:Matrix=ob.transform.matrix;
m.tx -= point.x;
m.ty -= point.y;
m.rotate (angleDegrees*(Math.PI/180));
m.tx += point.x;
m.ty += point.y;
ob.transform.matrix=m;
}