Rectangle 、getBounds(this)

var container:Sprite = new Sprite();
container.graphics.beginFill(0xffff00);
container.graphics.drawCircle(0,0,100);
container.graphics.endFill();
container.x = 200;
container.y = 200;
addChild(container);
var bounds:Rectangle = container.getBounds(this);
trace("bounds.top======="+bounds.top);

/*var contents:Shape = new Shape();
contents.graphics.beginFill(0xff00ff);
contents.graphics.drawCircle(0,0,50);
contents.graphics.endFill();
container.addChild(contents);*/

//trace("contents.getBounds(container)======"+contents.getBounds(container));
// (x=-100, y=-100, w=200, h=200)


//trace("contents.getBounds(this)======="+contents.getBounds(this));
// (x=0, y=0, w=200, h=200)
posted on 2011-02-22 10:47  602147629  阅读(651)  评论(0编辑  收藏  举报