红色父动画片段内的形状,
黄色父级影片剪辑中的子级
Image http://frontenddev.com/images/stack.png
我想为黄点设置动画,但要确保它们永远不会超出红色形状的边界。我该如何解决这个问题?
最佳答案
试试hitTestObject
.它评估显示对象以查看它是否与 obj
显示对象重叠或相交。
for each(var yellow:DisplayObject in yelloDotsArray)
{
if(yellow.hitTestObject(theRed))
trace("this dot is within the limits");
else
trace("this dot is outside the red area");
}
关于flash - AS3 : Make sure children stays inside parent movieclip's shape,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2465888/