WEB开发网
开发学院图形图像Flash Flash AS入门教程第七课:影片剪辑第10节用AS绘图... 阅读

Flash AS入门教程第七课:影片剪辑第10节用AS绘图

 2009-12-12 00:00:00 来源:WEB开发网   
核心提示: 有了这个方法我们就想把那朵花搞成桃花了,使用由红色到粉红色的放射填充,Flash AS入门教程第七课:影片剪辑第10节用AS绘图(6),效果:代码:importflash.geom.*;this.createEmptyMovieClip("mh_mc",this.getNex

有了这个方法我们就想把那朵花搞成桃花了,使用由红色到粉红色的放射填充。

效果:

代码:

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;

上一页  1 2 3 4 5 6 7  下一页

Tags:Flash AS 入门教程

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接