在 Flash CS4 中链接图像/图层 - 让它们一起移动
我有两个图像副本(一个称为“blurPic_mc”,一个称为“sharpPic_mc”),并且我希望能够将它们一起在屏幕上移动。对于我正在运行的其他一些功能,我需要它们完全保持在彼此之上,但现在唯一移动的是顶部的功能(sharpPic_mc)。有什么想法吗?我在下面包含了我的代码。
sharpPic_mc.addEventListener(MouseEvent.MOUSE_DOWN,Click);
sharpPic_mc.addEventListener(MouseEvent.MOUSE_UP,Release);
function Click(event:MouseEvent):void{
event.currentTarget.startDrag();
blurPic_mc.startDrag();
}
function Release(event:MouseEvent):void{
event.currentTarget.stopDrag();
blurPic_mc.startDrag();
}
I have two copies of an image (one called blurPic_mc & one called sharpPic_mc) and I want to be able to move both of them around the screen together. I need them to stay exactly on top of each other for some other functions I am running but right now the only one that moves is the top one (sharpPic_mc). Any Ideas? I included my code below.
sharpPic_mc.addEventListener(MouseEvent.MOUSE_DOWN,Click);
sharpPic_mc.addEventListener(MouseEvent.MOUSE_UP,Release);
function Click(event:MouseEvent):void{
event.currentTarget.startDrag();
blurPic_mc.startDrag();
}
function Release(event:MouseEvent):void{
event.currentTarget.stopDrag();
blurPic_mc.startDrag();
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相当确定 startDrag 一次只允许拖动一个 MovieClip。所以你会想要这样做。
I am fairly sure startDrag only allows one MovieClip to be dragged at a time. So you will want to do this.