简体   繁体   English

Flash 8 ActionScript-影片剪辑位置

[英]Flash 8 ActionScript - Movie Clip location

In Flash 8 I've created a movieclip. 在Flash 8中,我创建了一个动画片段。 Inside I've added 3 more symbols (movieclips). 在里面,我又添加了3个符号(电影剪辑)。 1 box and two images, goal is to drag and drop the rigt image in the box. 1个框和2个图像,目标是将绑定图像拖放到框中。 how do I do it? 我该怎么做?

on(press) {
startDrag("_root.FirstMC.RObject");
}

on(release) {
stopDrag();
if (_root.FirstMC.RObject._droptarget == "/Box") {
    gotoAndStop(3);
    }
}

What am I doing wrong? 我究竟做错了什么? I can drag and drop, but it does not recognize dropping location (does not go to frame 3). 我可以拖放,但它无法识别放置位置(不会转到第3帧)。 Any help? 有什么帮助吗?

Use hitTest, eg 使用hitTest,例如

onClipEvent (enterFrame){
    if (yourMC.hitTest(yourImage))
    {
        what is supposed to happen here...

    }

}

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM