Flash 图像遮罩不跟随电影动画

Flash 图像遮罩不跟随电影动画,flash,actionscript-3,Flash,Actionscript 3,我在舞台周围设置动画的图像上放置了一个遮罩,效果很好,但当我使用as3更改遮罩时,遮罩会停止跟随图像并停留在一个位置。。当图像在舞台上移动时。。。有没有办法强迫遮罩粘在图像上 // set the current mask to null face_mc.face_one.mask = null; // assign the new mask face_mc.face_one.mask = customShape; // the movie clip is animated by this m

我在舞台周围设置动画的图像上放置了一个遮罩,效果很好,但当我使用as3更改遮罩时,遮罩会停止跟随图像并停留在一个位置。。当图像在舞台上移动时。。。有没有办法强迫遮罩粘在图像上

// set the current mask to null
face_mc.face_one.mask = null;
// assign the new mask
face_mc.face_one.mask = customShape;

// the movie clip is animated by this method whcih tracks a point in a video clip
function cuepointlistener(evt:MetadataEvent):void{
    paramObj = evt.info.parameters;
    var values:Array = paramObj["Track Point 1_Attach Point"].split(/,/);
    face_mc.x = values[0];
    face_mc.y = values[1];
}

你可以把它们都放在一个
精灵中,然后移动它?

它们都在一个电影剪辑中,不是吗?是的,是一样的。所以你移动
MovieClip
时,遮罩会“掉”出来,在你改变它后会留在一个地方?你能发布一些代码吗?是
customShape
内部
face\u mc
?你知道一种改变面具形状而不是替换它的方法吗?你可以尝试将它包装成
Sprite
,只在内部改变
形状,看看会发生什么:)
// customShape has to be a child of face_mc

face_mc.addChild( customShape  );
face_mc.face_one.mask = customShape;