您的位置: 主页->Flash->Flash教程->正文
相关文章
·用FlashMX绘制世界杯会标
·日式漫画人物-头发造型
·日式漫画人物-头部造型
·日式漫画人物-鼻子嘴巴
·日式漫画人物-面部表情
·日式漫画人物-男性的眼睛
·日式漫画人物-女性的眼睛
·FLASH中创造角色注意事项
·角色透视行走动作分解
·FLASH读取本页URL参数
·几种线条效果
·FlashMX2004按钮翻页
·卡通人物的急速跑步
·绽放的烟火
·定时闹钟
·钟表的制作
·卡通人物面部造型入门
·人物造型
·人体结构

几种线条效果

http://www.yy0736.com 加入日期:2004.11.18 点击数:

查看:[大字体 中字体 小字体]

点击浏览该文件

点击浏览该文件

点击浏览该文件

点击浏览该文件

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

Stage.scaleMode = "noScale";
var depths = 1;
this.createEmptyMovieClip("dot", 0);
this.createEmptyMovieClip("l", -1);
with (dot) {
lineStyle(1, 0xffffff);
lineTo(1, 0);
_visible = false;
}
function drawLine() {
for (var i = depths; i<depths+4; i++) {
var d = 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)<1 and Math.abs(this._y-posy)<1) {
this.removeMovieClip();
}
};
}
}
this.onMouseDown = function() {
posx = _xmouse;
posy = _ymouse;
drawLine();
depths = depths>12 ? 1 : depths+4;
};

//as区已加分:)

 

作者:ycccc8202 来源:闪吧

   
 

上篇:FlashMX2004按钮翻页教程   下篇:如何让FLASH读取到本页URL中的参数

[夜鹰论坛] [我要留言] [关闭窗口] [ ][TOP]

此文章最新评论(不超过十条)
■评论此文章 ( 有问题请去夜鹰论坛发帖 )
共有评论: 查看全部评论 姓名:
【 声明 】 您所发表的言论将被众多网友阅读,因此,您所发表的言论应不违反中国法律,不违背一般的道德原则,否则,您必须对您的不当言论引发的一切不良后果负责;此外,我们的管理员有权删除您发表的不当言论,谢谢合作!