当前位置:软件学习 > Flash >>

flash Rectangle参数的问题

ar secondRect:Rectangle = new Rectangle(1, 3, 11, 13);
以上代码为什么会报错,说Rectangle参数不能超过二个。为什么呢?望高手说说吧

var secondRect:Rectangle = new Rectangle(1, 3, 11, 13); 不会报错,你看看脚本是2.0还是3.0的

package {
import flash.display.Sprite;
import flash.geom.Rectangle;

public class RectangleExample extends Sprite {

public function RectangleExample() {
var firstRect:Rectangle = new Rectangle();
trace(firstRect); // (x=0, y=0, w=0, h=0)
var secondRect:Rectangle = new Rectangle(1, 3, 11, 13);
trace(secondRect); // (x=1, y=3, w=11, h=13)
var thirdRect:Rectangle = new Rectangle(5, 8, 17, 19);
trace(thirdRect); // (x=5, y=8, w=17, h=19)
var isContained:Boolean = secondRect.containsRect(thirdRect);
trace(isContained); // false
}
}
}

补充:flash教程,动画技术
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,