首页 | IT新闻 | 硬件 | 操作系统 | 开发 | 网络编程 | 数据库 | 热门框架 | 网络安全 | 组网 | 建站指南 | 网页制作 | 特效 | 实用技巧 | 服务器 | 办公 | QQ | 探索 | 社区

  • 技术部落
  • 部落首页 > 网页特效 > 正文
  • 超酷的 action script 视觉效果代码
      2007-2-25  来源:网络资源  编辑:Jsbulo  热度:

    效果很玄flash action script,代码却很简单。

    大致代码如下:

    以下是引用片段:
    onClipEvent (load) {
    x=0 //where the dot is
    y=0 //where the dot is
    xmove=0 //it’s movement
    ymove=0 //it’s movement
    }
    onClipEvent (enterFrame) {
    xmove+= (_root._xmouse-_x-x)/10 //math
    ymove+= (_root._ymouse-_y-y)/10 //math
    x+=xmove+(_root._xmouse-_x-x)/10 //math
    y+=ymove+(_root._ymouse-_y-y)/10 //math
    clear()
    lineStyle(1,000000,100)
    moveTo(oldx,oldy)
    lineTo(x,y)
    oldx=x //this is so that in the next frame it knows where the dot was last frame
    oldy=y //this is so that in the next frame it knows where the dot was last frame
    _rotation-- //This is negative on two of the movieclips (that initially have an opposite rotation to eachother), and positive on the other two.
    }
    相关链接