2005/12/13 | globalToLocal与localToGloba
类别(让工作更简单) | 评论(0) | 阅读(210) | 发表于 19:46

pt=new Object();
pt.x=rectfather.rect.subrect._x;
pt.y=rectfather.rect.subrect._y;
rectfather.rect.localToGlobal(pt);
trace("pt_x:"+pt.x);
trace("pt_y:"+pt.y);
trace("ax:"+a._x);
trace("ax:"+a._y);


注意路径
rectfather.rect.localToGlobal(pt);

当然MC在rectfather.rect 下 那么路径就是rectfather.rect 而不是rectfather


pt=new Object();
pt.x=_root.clickmc._x;
pt.y=_root.clickmc._y;
_parent.globalToLocal(pt);
trace("pt_x 在RECTfather中:"+pt.x);
trace("pt_y 在RECTfather中:"+pt.y);

pt3=new Object();
pt3.x=_root.clickmc._x;
pt3.y=_root.clickmc._y;
globalToLocal(pt3);
trace("pt_x 在RECt中:"+pt3.x);
trace("pt_y 在RECt中:"+pt3.y);


pt2=new Object();
pt2.x=_root.clickmc._x;
pt2.y=_root.clickmc._y;
trace("pt2x 主场景:"+pt2.x);
trace("pt2y 主场景:"+pt2.y);
 

0

评论Comments