佳礼资讯网

 找回密码
 注册

ADVERTISEMENT

查看: 1139|回复: 5

Flash问题:Urgent......

[复制链接]
发表于 8-5-2007 09:30 PM | 显示全部楼层 |阅读模式
Hi....我是新手,请多多指教.我做了两个 part (Drap &drop)的练习(不同topic),都是用同样的coding.但当我combine&publish了过后,出现了问题,其中一个part有问题,当我drag过后,两个元件的位置都移了,而且接下来的第二,三问题.我用scene来link每一题.


                                                     M1(第一元件)

M3 (答案space)                                       M2(第二元件)                              




以下是我的coding:

1st frame 1st layer :

if(!started){
            x1=M1._x;
            y1=M1._y;
            x2=M2._x;
            y2=M2._y;
            tx1=M3._x;
            ty1=M3._y;
            started=true;
}

M1
onClipEvent (mouseDown) {
            if(hitTest(_root._xmouse,_root._ymouse,false)){
                        this.swapDepths(1);
                        startDrag(this,true);
            }
}
onClipEvent (mouseUp) {
            stopDrag();
            if(this.hitTest(_root.M3)){
                        _x=_root.tx1;
                        _y=_root.ty1;
} else {
            _x=_root.x1;
            _y=_root.y1;
}
}


M2

onClipEvent (mouseDown) {
            if(hitTest(_root._xmouse,_root._ymouse,false)){
                        this.swapDepths(1);
                        startDrag(this,true);
            }
}
onClipEvent (mouseUp) {
            stopDrag();
            if(this.hitTest(_root.M4)){
                        _x=_root.tx2;
                        _y=_root.ty2;
} else {
            _x=_root.x2;
            _y=_root.y2;
}
}

****请问我有什么或需要加什么coding才不会有这样Error?




[ 本帖最后由 YYo7 于 8-5-2007 09:35 PM 编辑 ]
回复

使用道具 举报


ADVERTISEMENT

发表于 11-5-2007 01:20 AM | 显示全部楼层
看不出所以然, 請把文件上傳比較容易檢查
而且也不知道你的combine是甚麼意思
回复

使用道具 举报

gg1980 该用户已被删除
发表于 11-5-2007 11:07 AM | 显示全部楼层
check your script attached to M2, lines 10,11
_x=_root.tx2;
_y=_root.ty2;

tx2 and ty2 is undefined.
回复

使用道具 举报

 楼主| 发表于 11-5-2007 11:40 AM | 显示全部楼层
谢谢supertomato的回复.....谢谢....因我不会upload去forum,但我尝试问朋友看如何upload。。。

[ 本帖最后由 YYo7 于 11-5-2007 11:43 AM 编辑 ]
回复

使用道具 举报

 楼主| 发表于 11-5-2007 11:55 AM | 显示全部楼层

回复 #2 super-tomato 的帖子

Erm.....M2 undefined coz only select 1  from 2 choices, so i put it undefined so the incorrect answer will go to the root position coz it can't find the tx2, ty2 in that question....Anyway....Tqtq....
回复

使用道具 举报

发表于 11-5-2007 07:22 PM | 显示全部楼层
if(!started){
            x1=M1._x;
            y1=M1._y;
            x2=M2._x;
            y2=M2._y;
            tx1=M3._x;
            ty1=M3._y;
            started=true;
}


把 started 的條件拿掉就可以了, 如

            x1=M1._x;
            y1=M1._y;
            x2=M2._x;
            y2=M2._y;
            tx1=M3._x;
            ty1=M3._y;
回复

使用道具 举报

Follow Us
您需要登录后才可以回帖 登录 | 注册

本版积分规则

 

ADVERTISEMENT



ADVERTISEMENT



ADVERTISEMENT

ADVERTISEMENT


版权所有 © 1996-2023 Cari Internet Sdn Bhd (483575-W)|IPSERVERONE 提供云主机|广告刊登|关于我们|私隐权|免控|投诉|联络|脸书|佳礼资讯网

GMT+8, 4-9-2025 04:15 AM , Processed in 0.128151 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表