繁体中文
设为首页
加入收藏
当前位置:网站制作首页 >> Flash教程 >> 几种线条效果

几种线条效果

2007-10-15 08:00:00  作者:  来源:互联网  浏览次数:0  文字大小:【】【】【
简介: 点击浏览该文件 点击浏览该文件 点击浏览该文件 点击浏览该文件 主要代码就是通过下面的进行一些调整就出来了以上好几种效果: Stage.scaleMode="noScale"; vardepths=1; this.createEmptyMovieClip("dot",0)...
关键字:线条 效果

点击浏览该文件

点击浏览该文件

点击浏览该文件

点击浏览该文件

主要代码就是通过下面的进行一些调整就出来了以上好几种效果:

Stage.scaleMode="noScale";

vardepths=1;

this.createEmptyMovieClip("dot",0);

this.createEmptyMovieClip("l",-1);

with(dot){

lineStyle(1,0xffffff);

lineTo(1,0);

_visible=false;

}

functiondrawLine(){

for(vari=depths;i

vard=dot.duplicateMovieClip("dot"+i,i,{_x:random(400),_y:random(400),a:0});

line=l.createEmptyMovieClip("line"+i,i);

line.clear();

line.lineStyle(1,0xffffff);

line.moveTo(d._x,d._y);

d.onEnterFrame=function(){

this.a+=5;

this.dx=posx-this._x;

this.dy=posy-this._y;

this.dis=Math.sqrt(this.dx*this.dx+this.dy*this.dy);

this.r=Math.atan2(this.dy,this.dx);

this._x+=this.dx/7-Math.sin(this.r)*this.dis/7*Math.sin(this.a*2);

this._y+=this.dy/7+Math.cos(this.r)*this.dis/7*Math.sin(this.a*2);

this._parent.l["line"+this._name.substr(3)].lineStyle(1,0xff0000,this.a);

this._parent.l["line"+this._name.substr(3)].lineTo(this._x,this._y);

if(Math.abs(this._x-posx)<1andMath.abs(this._y-posy)12?1:depths+4;

};

//as区已加分:)

责任编辑:admin
相关文章