Flash AS入门教程第七课:影片剪辑第10节用AS绘图
2009-12-12 00:00:00 来源:WEB开发网有了这个方法我们就想把那朵花搞成桃花了,使用由红色到粉红色的放射填充。
效果:
代码:
import flash.geom.*;
this.createEmptyMovieClip("mh_mc",this.getNextHighestDepth());
mh_mc._x = Stage.width /2;
mh_mc._y = Stage.height/2;
var color:Array = [0xFF0000,0xfee7f8];
var alph:Array= [100,100];
var rotio:Array = [0,255];
var matrix = new Matrix();
matrix.createGradientBox(40,100,Math.PI,-20,-40);//这里要填充的形状注册点是(0,0)这样就算出了-20,和-40(调整后的)
mh_mc.beginGradientFill("radial",color,alph,rotio,matrix);
mh_mc.moveTo(0,0);
mh_mc.curveTo(-20,-25,-10,-45);
mh_mc.curveTo(0,-60,10,-45);
mh_mc.curveTo(20,-25,0,0);
mh_mc.endFill();
for(i=0;i<5;i++){
mh_mc.duplicateMovieClip("mh"+i,this.getNextHighestDepth());
mh1_mc = eval("mh"+i);
mh1_mc._rotation= i*72;
}
this.createEmptyMovieClip("hz_mc",0);
hz_mc._x =Stage.width/2;
hz_mc._y = Stage.height/2;
hz_mc.lineStyle(6,663333,100);
hz_mc.moveTo(0,0);
hz_mc.curveTo(-5,110,0,160);
this.createEmptyMovieClip("hy_mc",this.getNextHighestDepth());
hy_mc._x =Stage.width/2;
hy_mc._y = Stage.height/2;
color = [0x0e730d,0x06db2b];
matrix.createGradientBox(60,20,Math.PI,10,50);
hy_mc.beginGradientFill("radial",color,alph,rotio,matrix);
hy_mc.moveTo(0,70);
hy_mc.curveTo(35,40,70,50);
hy_mc.curveTo(35,90,0,70);
hy_mc.endFill();
hy_mc.duplicateMovieClip("hy1_mc",this.getNextHighestDepth());
hy1_mc._xscale = -100;
hy1_mc._x =hy_mc._x -6;
hy1_mc._y =hy_mc._y +10;
- ››ASP.NET及JS中的cookie基本用法
- ››ASP.NET获取MS SQL Server安装实例
- ››asp.net实现调用百度pai 在线翻译英文转中文
- ››ASP.NET页面选项进行提示判断
- ››Asp.net定时执行程序
- ››ASP.NET中利用DataList实现图片无缝滚动
- ››ASP.NET验证控件RequiredFieldValidator
- ››ASP.NET中使用System.Net.Mail发邮件
- ››ASP.NET中获取用户控件中控件的ID
- ››ASP.NET中FileBytes写成文件并存档
- ››asp获取毫秒数
- ››asp.net报“INSERT INTO 语句的语法错误解决
更多精彩
赞助商链接