Flash CS3 ドキュメンテーション |
|||
| ActionScript 2.0 リファレンスガイド > ActionScript クラス > Transform (flash.geom.Transform) > matrix (Transform.matrix プロパティ) | |||
public matrix : Matrix
ムービークリップの拡大・縮小、回転、および変換に影響を与える値を格納している変換用 Matrix オブジェクトです。
対応バージョン : ActionScript 1.0、Flash Player 8
次の例では、Matrix オブジェクト scaleMatrix を Transform オブジェクト trans に適用します。この Matrix は、MovieClip rect を 2 倍に拡大します。
import flash.geom.Transform;
import flash.geom.Matrix;
var rect:MovieClip = createRectangle(20, 80, 0xFF0000);
var trans:Transform = new Transform(rect);
trace(trans.matrix); // (a=1, b=0, c=0, d=1, tx=0, ty=0)
var scaleMatrix:Matrix = new Matrix();
scaleMatrix.scale(2, 2);
rect.onPress = function() {
trans.matrix = scaleMatrix;
trace(trans.matrix); // (a=2, b=0, c=0, d=2, tx=0, ty=0)
}
function createRectangle(width:Number, height:Number, color:Number, scope:MovieClip):MovieClip {
scope = (scope == undefined) ? this : scope;
var depth:Number = scope.getNextHighestDepth();
var mc:MovieClip = scope.createEmptyMovieClip("mc_" + depth, depth);
mc.beginFill(color);
mc.lineTo(0, height);
mc.lineTo(width, height);
mc.lineTo(width, 0);
mc.lineTo(0, 0);
return mc;
}
このページに新しいコメントが追加された場合に、電子メールでの通知を希望する。 | コメントレポート
現在のページ: http://livedocs.adobe.com/flash/9.0_jp/main/00002300.html