JsFL を介した Flash Transformation Matrix は私にとって意地悪です :(
Flash シーンにテキストを作成する JsFL スクリプトを作成し、ランダムな角度で回転させる必要があります。「Hello World!」を作成してローテーションしたいとします。45 度で、私のコードは次のようになります。
rotateAngle = 45;
//creates my new text at x:0, y:0 coordinates
fl.getDocumentDOM().addNewText({left:0, top:0, right:10, bottom:10});
fl.getDocumentDOM().setTextString('Hello World!');
var mat = fl.getDocumentDOM().selection[0].matrix; //get the current matrix
// set rotation
mat.a = Math.cos( rotateAngle );
mat.b = Math.sin( rotateAngle);
mat.c = - Math.sin(rotateAngle);
mat.d = Math.cos( rotateAngle );
fl.getDocumentDOM().selection[0].matrix = mat; //apply new matrix
問題は、テキストに適用される回転が 45 ではなく 58.3 であることです。
私はマトリックスの初心者であることを認めなければなりません...そこで、ここで「回転のためのマトリックス変換」を使用しました:http://www.senocular.com/flash/tutorials/transformmatrix/
アイデア?
ありがとうございました。