佳礼资讯网

 找回密码
 注册

ADVERTISEMENT

查看: 1891|回复: 5

又有新问题了。。。。请去第4楼....check button的问题

[复制链接]
发表于 13-4-2007 05:33 PM | 显示全部楼层 |阅读模式
我用做配对游戏,有两个问题,一个一个问题一个scene
第一个scene时没问题,但是在第二scene时就出现问题了...
coding:
建立两个元件,第一元件

onClipEvent (mouseDown){
if(this.hitTest(_root._xmouse,_root._ymouse,false)){
  this.swapDepths(1);
  startDrag(this,true);
  }

}
onClipEvent (mouseUp) {
stopDrag();
if(this.hitTest(_root.b2)){
  _x=_root.tx2;
  _y=_root.ty2;

  }else{
  _x=_root.x1;
  _y=_root.y1;
   }
}


第二元件
onClipEvent (mouseDown){
if(this.hitTest(_root._xmouse,_root._ymouse,false)){
  this.swapDepths(1);
  startDrag(this,true);
  }

}
onClipEvent (mouseUp) {
stopDrag();
if(this.hitTest(_root.b1)){
  _x=_root.tx1;
  _y=_root.ty1;

  }else{
  _x=_root.x2;
  _y=_root.y2;
   }
}

在第一个 frame

if(!started){
x1=a1._x;
y1=a1._y;
x2=a2._x;
y2=a2._y;
tx1=b1._x;
ty1=b1._y;
tx2=b2._x;
ty2=b2._y;
started=true;
}
stop();



为什么在第二个时第一个的元件依然会出现。。。???

[ 本帖最后由 不做天使 于 15-4-2007 02:10 PM 编辑 ]
回复

使用道具 举报


ADVERTISEMENT

发表于 13-4-2007 09:55 PM | 显示全部楼层
可以在 scene 2 的第一个 frame 放
removeMovieClip(元件一);
removeMovieClip(元件二);
回复

使用道具 举报

 楼主| 发表于 15-4-2007 01:45 PM | 显示全部楼层

回复 #2 cshaopin 的帖子

多谢,我去试试看...
回复

使用道具 举报

 楼主| 发表于 15-4-2007 02:05 PM | 显示全部楼层
新的问题。。。。

做了一个check答案的button...
为什么永远都显示出错呢??

button check 的as
on (release) {
            if (_root.a1.c == 1 && _root.a2.c == 1 && _root.a3.c == 1 && _root.a4.c == 1 && _root.a5.c == 1&& _root.a6.c == 1) {
                        gotoAndStop(3);
            } else {
                        gotoAndStop(2);
            }
         
}

这是在mc的as,
onClipEvent (mouseDown) {
            if (hitTest(_root._xmouse, _root._ymouse)) {
                        startDrag(this, true);
            }
}
onClipEvent (mouseUp) {
            if (this.hitTest(_root.b1)) {
                        this._x = 145;
                        this._y = 130;
                        stopDrag();
                        c = 1;
            } else if (this.hitTest(_root.b2)) {
                        this._x = 160;
                        this._y = 180;
                        stopDrag();
                        c = 0;
            } else if (this.hitTest(_root.b3)) {
                        this._x = 180;
                        this._y = 220;
                        stopDrag();
                        c = 0;
            } else if (this.hitTest(_root.b4)) {
                        this._x = 270;
                        this._y = 240;
                        stopDrag();
                        c = 0;
            } else if (this.hitTest(_root.b5)) {
                        this._x = 140;
                        this._y = 270;
                        stopDrag();
                        c = 0;
            } else if (this.hitTest(_root.b6)) {
                        this._x = 270;
                        this._y = 300;
                        stopDrag();
                        c = 0;
            } else {
                        this._x = 60;
                        this._y = 70;
                        stopDrag();
                        c = 0;
            }
}
底是那里出错了呢??



回复

使用道具 举报

发表于 7-6-2017 11:54 PM | 显示全部楼层
本帖最后由 123JO123 于 3-9-2017 07:24 PM 编辑

??
回复

使用道具 举报

发表于 3-9-2017 07:22 PM | 显示全部楼层
本帖最后由 123JO123 于 3-9-2017 07:24 PM 编辑

wong
回复

使用道具 举报

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

本版积分规则

 

ADVERTISEMENT



ADVERTISEMENT



ADVERTISEMENT

ADVERTISEMENT


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

GMT+8, 20-4-2024 01:00 AM , Processed in 0.069170 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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