flash AS3 影片剪辑的 深度.使影片剪辑在其它剪辑的上面。请看补充。
面版上有m1m2m3三个紧靠着的影片剪辑。当单击m1时,使m1的scaleX为2.它的宽度变大了,但是它被m2挡住了。怎样使m1在其它剪辑的上面。...
面版上有m1 m2 m3三个紧靠着的影片剪辑。当单击m1时,使m1的scaleX为2.它的宽度变大了,但是它被m2挡住了。怎样使m1在其它剪辑的上面。
展开
展开全部
方便起见,写了时间轴代码,你试试吧
for (var i:int=1; i<=3; i++) {
AddListener(this.getChildByName("m"+i));
}
function AddListener(mc:*):void {
mc.addEventListener(MouseEvent.MOUSE_OVER,ChangeScale);
mc.addEventListener(MouseEvent.MOUSE_OUT,ChangeScale);
}
function ChangeScale(e:MouseEvent):void {
if (e.type=="mouseOver") {
this.swapChildren(e.target as DisplayObject,getChildAt(this.numChildren-1));
e.target.scaleX=2;
e.target.scaleY=2;
} else {
e.target.scaleX=1;
e.target.scaleY=1;
}
}
for (var i:int=1; i<=3; i++) {
AddListener(this.getChildByName("m"+i));
}
function AddListener(mc:*):void {
mc.addEventListener(MouseEvent.MOUSE_OVER,ChangeScale);
mc.addEventListener(MouseEvent.MOUSE_OUT,ChangeScale);
}
function ChangeScale(e:MouseEvent):void {
if (e.type=="mouseOver") {
this.swapChildren(e.target as DisplayObject,getChildAt(this.numChildren-1));
e.target.scaleX=2;
e.target.scaleY=2;
} else {
e.target.scaleX=1;
e.target.scaleY=1;
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询