查看: 1139|回复: 5
|
Flash问题:Urgent......
[复制链接]
|
|
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 编辑 ] |
|
|
|
|
|
|
|
发表于 11-5-2007 01:20 AM
|
显示全部楼层
看不出所以然, 請把文件上傳比較容易檢查
而且也不知道你的combine是甚麼意思 |
|
|
|
|
|
|
|
发表于 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; |
|
|
|
|
|
|
| |
本周最热论坛帖子
|