下面通过实例8-1说明。
在舞台上建立一个矩形MovieClip,命名为rect1,宽110px,高80px,同时复制两次,分别命名为rect2,rect3,水平等距排列,如图2所示。
在时间轴上写入代码:
trace("rect1 widht:"+rect1.width+",Height:"+rect1.height);
rect2.rotation=30;
trace("rect2 widht:"+rect2.width+",Height:"+rect2.height);
rect3.width=20;
rect3.height=-100;
trace("rect3 widht:"+rect3.width+",Height:"+rect3.height);
运行显示如图8-3:
同时程序Output窗口输出信息:
rect1 widht:110,Height:80
rect2 widht:135.25,Height:124
rect3 widht:20,Height:80
rect2围绕左上角旋转后,对象的width和height都发生了变化。rect3的宽度被设置为20,对象被水平压缩,而高度没有改变。