Flash AS实例教程:制作铅笔动画_Flash教程

编辑Tag赚U币
教程Tag:暂无Tag,欢迎添加,赚取U币!

推荐:用Flash AS3制作常见的柄图动画效果
效果如下:说明:点击上面的蓝色按钮可以画出各种柄图,点击柄图中不同色块可以观看效果。代码如下:/***@class:DrawPieGraph(画饼状图)*@author:ycccc8

用一段简单的AS代码就可以实现简单的铅笔动画效果。

直接复制代码,导出就可以看到效果了:
_root.createEmptyMovieClip("pen", 1);
pen.lineStyle(2, 0x000000);
pen._x = 200;
pen._y = 200;
pen.beginFill(0x444444, 100);
pen.lineTo(30, -10);
pen.lineTo(200, -10);
pen.lineTo(200, 10);
pen.lineTo(30, 10);
pen.lineTo(30, -10);
pen.beginFill(0x333311, 100);
endFill(pen);
pen.beginFill(0xf9f999, 100);
pen.lineTo(0, 0);
pen.lineTo(30, 10);
pen.lineTo(30, -10);
endFill(pen);
pen._rotation = -50;
n = 0;
r = 100;
a = 1;
k = 10;
tt = 0;
lineStyle(2);
moveTo(Math.cos(0*Math.PI/180)*r 200, pen._y);
ss = setInterval(function () {
a ;
if (a>3) {
a = 1;
}
if (a == 1) {
lineStyle(2, 0xff0000);
}
if (a == 2) {
lineStyle(2, 0x00ff00);
}
if (a == 3) {
lineStyle(2, 0x0000ff);
}
n = 30
r -=0.3
if (n<20000) {
pen._x = Math.cos(n*Math.PI/180)*r 200;
pen._y = Math.sin(n*Math.PI/180)*r 200;
lineTo(pen._x, pen._y);
}
updateAfterEvent();
if (n>=20000) {
aa = setInterval(function () {
updateAfterEvent();
tt ;
if (tt>5000) {
clearInterval(aa);
clearInterval(ss);
}
pen._rotation = Math.sin(n*Math.PI/180)*5 90;
}, 5);
_root.createTextField("t", 2, 300, 350, 150, 20);
t.text = "By FLASH8菜鸟 kingofkofs";
pen._x = 400;
pen._y = 120;
}
}, 5);
sp = 0;
f = 20;
this.onEnterFrame = function() {
if (tt>5000) {
pen._y -= sp;
sp = 2;
}
if (sp>f) {
sp = -f;
if (f>=4) {
f -= 4;
}
}
};

分享:Flash绘画技巧:绘制女孩头像
嘿嘿!很久没有画过东东了!1、首先画以下图形。(女孩脸的轮廓)2、再加上线。3、把画上的直线拖成弧线。4、去掉多余的直线休整得到。5、再改成封闭

来源:闪吧BBS//所属分类:Flash教程/更新时间:2008-03-05
相关Flash教程