Flash影片剪辑碰撞---偶尔失效问题!呵呵 俗话说碰撞失灵了---

将_root.getNextHighestDepth(), 参数改成 1000就行了 或者任意值

错误分析:1:getNextHighestDepth(), 方法-----可用性:ActionScript 1.0、Flash Player 7

              2:("图标"+objectID, "ball_"+objectID    ----新旧目标的ID不要相同,深度不要相同

改正:curIcon = attachMovie("图标"+objectID, "ball_"+_root.shendu,_root.shendu, {_x:Math.random()*90+450, _y:Math.random()*30});

  总结:因为as的版本很多 所以不要错误啊!这种错误很难找出来的    看上去就是正确的,加之你有没见过其他版语言

    哈哈 版本方法错用了哦

function CopyPiao()//飘的对象
{
 var objectID=(random(22)+1);
 //处理ID _x,_y
 curIcon = attachMovie("图标"+objectID, "ball_"+objectID, _root.getNextHighestDepth(), {_x:Math.random()*90+450, _y:Math.random()*30});
 //处理速度  (经测试)
 trace("curIcon="+curIcon);
 curIcon.xspeed = random(2)-3;//Math.random()*1+3;//Math.random()*7+1;//Math.random()*8;//Math.random()*8;
 curIcon.yspeed = random(4)+2 ;//Math.random()*5+1;//Math.random()*6;
    //处理大小
 scale = Math.random()*50+50;
    curIcon._xscale = scale;
    curIcon._yscale = scale;
 //宝物出现的处理
    //baoNum = baoNum + 1;
//    if (baoNum >= 5)
//    {
//        baoNum = 0;
//        ShowBao();
//    } // end if
 curIcon.onEnterFrame = function() {
  this._x += this.xspeed;
  this._y += this.yspeed;
  //if(this.hitTest(_root.mc_panda._x,_root.mc_panda._y,false))
  if(this.hitTest(_root.mc_panda))
  {
   trace("OK");
   _root.touch_music.start();//加分音乐
   _root.count++;           //数目++
   _root.m_count=_root.count;
   _root.score+=_root.levels*100;
   //for(var i=1;i<String(count).length+1;i++)
//   {
//     if(i!=5)
//     {
//      tmpArray[i-1]=String(count+1000).charAt(i-1);
//      eval("s"+(i-1)).gotoAndPlay(tmpArray[i-1]);
//      }
//   }
   //成绩++
   unloadMovie(this);
   }
  else if(this._y>=590)
  {
   unloadMovie(this);
  }
  
 }
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值