首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Flash >

求改flash擦除特效,该如何处理

2012-03-15 
求改flash擦除特效请看这个flash:http://www.ekoooo.com/html/flashsucai/donghuazhizuo/201004/22-188045

求改flash擦除特效
请看这个flash:http://www.ekoooo.com/html/flashsucai/donghuazhizuo/201004/22-1880452.html
这个特效是当鼠标在画面上移动时显示下面的图片。我用硕思闪客精灵得到了fla文件,这张车的图片是影片剪辑,加入了如下脚本:
onClipEvent (load)
{
  function drawSquare()
  {
  x = _root._xmouse;
  y = _root._ymouse;
  with (_root.square)
  {
  moveTo(x - 50, y - 50);
  beginFill(136);
  lineTo(x + 50, y - 50);
  lineTo(x + 50, y + 50);
  lineTo(x - 50, y + 50);
  endFill();
  } // End of with
  } // End of the function
  _root.createEmptyMovieClip("square", 0);
  _root.maskee.setMask(_root.square);
}
onClipEvent (mouseMove)//注意这里是mouseMove
{
  drawSquare();
  updateAfterEvent();
}
现在我想把它改成当鼠标在画面上按住不放开并移动时显示下面的图片,但是没有对应的鼠标事件。我把代码改成了这样:
onClipEvent (load)
{
  function drawSquare()
  {
  x = _root._xmouse;
  y = _root._ymouse;
  with (_root.square)
  {
  moveTo(x - 50, y - 50);
  beginFill(136);
  lineTo(x + 50, y - 50);
  lineTo(x + 50, y + 50);
  lineTo(x - 50, y + 50);
  endFill();
  } // End of with
  } // End of the function
  _root.createEmptyMovieClip("square", 0);
  _root.maskee.setMask(_root.square);
}
onClipEvent (mouseDown)
{
  onMouseMove=function()
  {
  drawSquare();
  updateAfterEvent();
  }
}
但是这样并没有实现我想要的效果,现在是当鼠标按下并移动之后鼠标所到之处会显示图片(实现遮罩),不会因为鼠标松开而停止。
求高手把代码改成当鼠标松开后能停止显示图片的效果。

[解决办法]
//在后面加上这句
onClipEvent (mouseUp)
{
delete onMouseMove;
}

热点排行