三角函数与Flash图形动画_第1页
三角函数与Flash图形动画_第2页
三角函数与Flash图形动画_第3页
三角函数与Flash图形动画_第4页
三角函数与Flash图形动画_第5页
已阅读5页,还剩139页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、三角函数与Flash图形动画吴占鹏(信箱:wzp1231999,电话利用正弦和余弦三角函数的周期变化及加、减、乘的运算,形成叠加、加倍、交叉、插入等效果,可以生成各种样式的图形。1. 叠加波一:。var mc:Sprite= addChild(new Sprite() as Sprite,p:Number=Math.PI/90;mc.graphics.lineStyle(2,0xff0000),mc.graphics.moveTo(0,80);for (var i:int=0; i<550; i+) mc.graphics.lineTo(i,80+20*Math

2、.sin(i*p);mc.graphics.lineStyle(2,0x00ff00),mc.graphics.moveTo(0,160);for (i=0; i<550; i+) mc.graphics.lineTo(i,160+20*Math.sin(i*p);mc.graphics.lineStyle(2,0x0000ff),mc.graphics.moveTo(0,250);for (i=0; i<550; i+) mc.graphics.lineTo(i,240+10*Math.sin(i*3*p)+30*Math.sin(i*p);-2叠加波二 :var mc:Spri

3、te= addChild(new Sprite() as Sprite;var p:Number=Math.PI/90;mc.graphics.lineStyle(2,0xff0000),mc.graphics.moveTo(0,80)for(var i:int=0;i<550;i+) mc.graphics.lineTo(i,80+20*Math.cos(i*p)mc.graphics.lineStyle(2,0x00ff00),mc.graphics.moveTo(0,160)for(i=0;i<550;i+) mc.graphics.lineTo(i,160+20*Math.

4、cos(i*3*p)mc.graphics.lineStyle(2,0x0000ff),mc.graphics.moveTo(0,250)for(i=0;i<550;i+) mc.graphics.lineTo(i,240+10*Math.cos(i*3*p)+30*Math.cos(i*p)3叠加波三:var mc:Sprite= addChild(new Sprite() as Sprite;var p:Number=Math.PI/90;mc.graphics.lineStyle(2,0xff0000),mc.graphics.moveTo(0,100)for(var i:int=

5、0;i<550;i+) mc.graphics.lineTo(i,80+20*Math.cos(i*p)mc.graphics.lineStyle(2,0x00ff00),mc.graphics.moveTo(0,180) for(i=0;i<550;i+) mc.graphics.lineTo(i,160+20*Math.cos(i*2*p)mc.graphics.lineStyle(2,0x0000ff),mc.graphics.moveTo(0,270)for(i=0;i<550;i+) mc.graphics.lineTo(i,240+10*Math.cos(i*2*

6、p)+20*Math.cos(i*p) -4叠加波四:var mc:Sprite= addChild(new Sprite() as Sprite;var p:Number=Math.PI/90;mc.graphics.lineStyle(2,0xff0000),mc.graphics.moveTo(0,80) for(var i:int=0;i<550;i+) mc.graphics.lineTo(i,80+20*Math.sin(i*p)mc.graphics.lineStyle(2,0x00ff00),mc.graphics.moveTo(0,160)for(i=0;i<55

7、0;i+) mc.graphics.lineTo(i,160+20*Math.sin(i*2*p)mc.graphics.lineStyle(2,0x0000ff),mc.graphics.moveTo(0,250)for(i=0;i<550;i+) mc.graphics.lineTo(i,240+15*Math.sin(i*2*p)+30*Math.sin(i*p)5. 叠加波五:var mc:Sprite= addChild(new Sprite() as Sprite;var p:Number=Math.PI/90;mc.graphics.lineStyle(2,0xff0000

8、),mc.graphics.moveTo(0,100)for(var i:int=0;i<550;i+) mc.graphics.lineTo(i,80+20*Math.cos(i*p)mc.graphics.lineStyle(2,0x00ff00),mc.graphics.moveTo(0,180)for(i=0;i<550;i+) mc.graphics.lineTo(i,160+20*Math.cos(i*2*p)mc.graphics.lineStyle(2,0x0000ff),mc.graphics.moveTo(0,260) for(i=0;i<550;i+)

9、mc.graphics.lineTo(i,240+10*Math.sin(i*2*p)+20*Math.cos(i*p)6.强制滤波:var mc:Sprite= addChild(new Sprite() as Sprite;var p:Number=Math.PI/90,j:Number;mc.graphics.lineStyle(2,0xff0000),mc.graphics.moveTo(0,185)for(var i:int=0;i<550;i+) Math.sin(i*p)+0.5<0?j=0:Math.sin(i*p)+0.5>1?j=1:j=Math.sin(

10、i*p)+0.5; mc.graphics.lineTo(i,160+j*50)mc.graphics.lineStyle(2,0x00ff00),mc.graphics.moveTo(0,180)for(i=0;i<550;i+) Math.sin(i+60)*p)+0.5<0?j=0:Math.sin(i+60)*p)+0.5>1?j=1:j=Math.sin(i+60)*p)+0.5;mc.graphics.lineTo(i,160+j*50)mc.graphics.lineStyle(2,0x0000ff),mc.graphics.moveTo(0,210)for(i

11、=0;i<550;i+) Math.sin(i+120)*p)+0.5<0?j=0:Math.sin(i+120)*p)+0.5>1?j=1:j=Math.sin(i+120)*p)+0.5;mc.graphics.lineTo(i,160+j*50)加倍效果利用正弦三角函数三倍周期叠加,实现环形波上下平滑;利用小数倍实现波插入效果。var sp:Sprite=addChild(new Sprite() as Sprite;sp.x=275,sp.z=0,sp.y=-200;var mc:Sprite=sp.addChild(new Sprite() as Sprite;va

12、r t:uint=0,f:Number=800,p:Number=Math.PI/60var x1:Number=120,z1:Number=0,y1:Number=400;mc.graphics.lineStyle(2,0xff0000);mc.graphics.moveTo(x1*f/(f+z1),y1*f/(f+z1);addEventListener(Event.ENTER_FRAME,fff);function fff(e) x1=120*Math.cos(t*p);z1=120*Math.sin(t*p);y1=400-12*(5*Math.sin(t*(2+1/5)*p)+Mat

13、h.sin(t*3*(2+1/5)*p);mc.graphics.lineTo(x1*f/(f+z1),y1*f/(f+z1);t<960?t=t+1:removeEventListener(Event.ENTER_FRAME,fff);/周期=60*2*5,插入次数=5。var mc:Sprite= addChild(new Sprite() as Sprite;var t:uint=0,x1:Number,y1:Number,p:Number=Math.PI/90;mc.graphics.lineStyle(2,0xff0000);mc.graphics.moveTo(200,320

14、);addEventListener(Event.ENTER_FRAME,fff);function fff(e) x1=200+40*Math.sin(t*p)*(2+Math.cos(t*5*p);y1=200+40*Math.cos(t*p)*(2+Math.cos(t*5*p);mc.graphics.lineTo(x1,y1);t<180?t=t+1:removeEventListener(Event.ENTER_FRAME,fff)利用余弦三角函数三倍或余弦+二倍正弦周期叠加中间平滑,实现盆底部边缘效果。var sp:Sprite=addChild(new Sprite()

15、as Sprite;sp.x=275,sp.z=0,sp.y=-200;var mc:Sprite=sp.addChild(new Sprite() as Sprite;var t:uint=0,f:Number=800,p:Number=Math.PI/60var x1:Number=200,z1:Number=0,y1:Number=392;var v:Number,u:Number,w:Number;mc.graphics.lineStyle(2,0xff0000);mc.graphics.moveTo(x1*f/(f+z1),y1*f/(f+z1);addEventListener(E

16、vent.ENTER_FRAME,fff);function fff(e) u=3*Math.cos(t*9.375*p)+8*Math.cos(t*3.125*p); u<0?v=0:u>9?v=9:v=u;u>9?w=9:w=u;x1=10*Math.cos(t*p)*(11+w)z1=10*Math.sin(t*p)*(11+w)y1=500-12*vmc.graphics.lineTo(x1*f/(f+z1),y1*f/(f+z1);t<960?t=t+1:removeEventListener(Event.ENTER_FRAME,fff);var sp:Spr

17、ite=addChild(new Sprite() as Sprite;sp.x=275,sp.z=0,sp.y=-100;var mc:Sprite=sp.addChild(new Sprite() as Sprite;var t:uint=0,f:Number=600,p:Number=Math.PI;var x1:Number,z1:Number,y1:Number,v:Number,u:Number;mc.graphics.lineStyle(3,0xff0000);mc.graphics.moveTo(144,343);addEventListener(Event.ENTER_FRA

18、ME,fff);function fff(e) u=Math.sin(t*p/7)+1.9*Math.cos(t*p/14)u<0?v=0:v=u;x1=30*Math.cos(t*p/54)*(2.9+u)z1=30*Math.sin(t*p/54)*(2.9+u)y1=400-30*v;mc.graphics.lineTo(x1*f/(f+z1),y1*f/(f+z1);t+;if (t>756) removeEventListener(Event.ENTER_FRAME,fff);5圆角多边形var sp:Sprite=addChild(new Sprite() as Spr

19、ite;var x1:Number,y1:Number,i:int,p:Number=Math.PI/36;sp.graphics.lineStyle(2,0xff0000),sp.graphics.moveTo(150,165);for(i=0;i<73;i+) x1=100+50*Math.cos(i*p)+15*Math.sin(i*2*p);y1=150+50*Math.sin(i*p)+15*Math.cos(i*2*p)sp.graphics.lineTo(x1,y1);sp.graphics.lineStyle(2,0x00ff00),sp.graphics.moveTo(

20、280,142);for(i=0;i<73;i+) x1=230+50*Math.cos(i*p)+12*Math.sin(i*3*p);y1=130+50*Math.sin(i*p)+12*Math.cos(i*3*p)sp.graphics.lineTo(x1,y1);sp.graphics.lineStyle(2,0x0000ff),sp.graphics.moveTo(410,138);for(i=0;i<73;i+) x1=360+50*Math.cos(i*p)+8*Math.sin(i*4*p);y1=130+50*Math.sin(i*p)+8*Math.cos(i

21、*4*p)sp.graphics.lineTo(x1,y1);sp.graphics.lineStyle(2,0x0000f00),sp.graphics.moveTo(540,135);for(i=0;i<73;i+) x1=490+50*Math.cos(i*p)+5*Math.sin(i*5*p);y1=130+50*Math.sin(i*p)+5*Math.cos(i*5*p)sp.graphics.lineTo(x1,y1);整数倍周期交叉效果var sp:Sprite=addChild(new Sprite() as Sprite;var x1:Number,y1:Numbe

22、r,i:int,p:Number=Math.PI/90;sp.graphics.lineStyle(2,0xff0000),sp.graphics.moveTo(100,180);for(i=0;i<181;i+) x1=100+20*Math.sin(i*p)-30*Math.sin(i*2*p);y1=130+20*Math.cos(i*p)+30*Math.cos(i*2*p)sp.graphics.lineTo(x1,y1);sp.graphics.lineStyle(2,0x00ff00),sp.graphics.moveTo(230,180);for(i=0;i<181

23、;i+) x1=230+20*Math.sin(i*p)-30*Math.sin(i*3*p);y1=130+20*Math.cos(i*p)+30*Math.cos(i*3*p)sp.graphics.lineTo(x1,y1);sp.graphics.lineStyle(2,0x0000ff),sp.graphics.moveTo(360,180);for(i=0;i<181;i+) x1=360+20*Math.sin(i*p)-30*Math.sin(i*4*p);y1=130+20*Math.cos(i*p)+30*Math.cos(i*4*p)sp.graphics.line

24、To(x1,y1);sp.graphics.lineStyle(2,0x0000f00),sp.graphics.moveTo(490,180);for(i=0;i<181;i+) x1=490+20*Math.sin(i*p)-30*Math.sin(i*5*p);y1=130+20*Math.cos(i*p)+30*Math.cos(i*5*p)sp.graphics.lineTo(x1,y1);-var sp:Sprite=addChild(new Sprite() as Sprite;var x1:Number,y1:Number,i:int,p:Number=Math.PI/9

25、0;sp.graphics.lineStyle(2,0xff0000),sp.graphics.moveTo(100,70);for(i=0;i<181;i+) x1=100+40*Math.sin(i*2*p)-20*Math.sin(i*3*p);y1=130-40*Math.cos(i*2*p)-20*Math.cos(i*3*p)sp.graphics.lineTo(x1,y1);sp.graphics.lineStyle(2,0x00ff00),sp.graphics.moveTo(230,70);for(i=0;i<181;i+) x1=230+40*Math.sin(

26、i*3*p)-20*Math.sin(i*4*p);y1=130-40*Math.cos(i*3*p)-20*Math.cos(i*4*p)sp.graphics.lineTo(x1,y1);sp.graphics.lineStyle(2,0x0000ff),sp.graphics.moveTo(360,70);for(i=0;i<181;i+) x1=360+40*Math.sin(i*4*p)-20*Math.sin(i*5*p);y1=130-40*Math.cos(i*4*p)-20*Math.cos(i*5*p)sp.graphics.lineTo(x1,y1);sp.grap

27、hics.lineStyle(2,0x0000f00),sp.graphics.moveTo(490,70);for(i=0;i<181;i+) x1=490+40*Math.sin(i*5*p)-20*Math.sin(i*6*p);y1=130-40*Math.cos(i*5*p)-20*Math.cos(i*6*p)sp.graphics.lineTo(x1,y1);-插入效果插入+叠加效果var x1:Number,z1:Number,y1:Numbervar t:uint=0,f:Number=900,p:Number=Math.PI/90;mc.graphics.lineSt

28、yle(2,0xff0000);mc.graphics.moveTo(200,400);addEventListener(Event.ENTER_FRAME,fff);function fff(e) x1=200*Math.cos(t*p);z1=200*Math.sin(t*p);y1=400+50*Math.sin(t*(6+1/7)*p);mc.graphics.lineTo(x1*f/(f+z1),y1*f/(f+z1);t+;if (t>1260) / 总周期=90*2*7removeEventListener(Event.ENTER_FRAME,fff);var sp:Spr

29、ite=addChild(new Sprite() as Sprite;sp.x=275,sp.z=0,sp.y=-250;var mc:Sprite=sp.addChild(new Sprite() as Sprite;var x1:Number,z1:Number,y1:Number,p:Number=Math.PI/90;var t:uint=0,f:Number=900,u=(6+1/7)*p;mc.graphics.lineStyle(2,0xff0000);mc.graphics.moveTo(200,400);addEventListener(Event.ENTER_FRAME,

30、fff);function fff(e) x1=200*Math.cos(t*p),z1=200*Math.sin(t*p);y1=400+50*Math.sin(t*u)+20*Math.sin(t*3*u);mc.graphics.lineTo(x1*f/(f+z1),y1*f/(f+z1);t<1260?t=t+1:removeEventListener(Event.ENTER_FRAME,fff);回旋+插入+叠加效果var sp:Sprite= addChild(new Sprite() as Sprite;sp.x=275,sp.z=0,sp.y=-250;var mc:Sp

31、rite= sp.addChild(new Sprite() as Sprite;var t:uint=0,f:Number=900,p:Number=Math.PI/72;var x1:Number=200,z1:Number=0,y1:Number=400,u:Number=4+1/5;mc.graphics.lineStyle(2,0xff0000);mc.graphics.moveTo(x1*f/(f+z1),y1*f/(f+z1);addEventListener(Event.ENTER_FRAME,fff);function fff(e) x1=200*Math.cos(t-6*M

32、ath.sin(t*6*p)*p);z1=200*Math.sin(t-6*Math.sin(t*6*p)*p);y1=400+40*Math.sin(t*u*p)+5*Math.sin(t*3*u*p);mc.graphics.lineTo(x1*f/(f+z1),y1*f/(f+z1);t<720?t=t+1:removeEventListener(Event.ENTER_FRAME,fff);6.五角星四种画法var mc:Sprite=addChild(new Sprite() as Sprite;var y1:Number,x1:Number,p:Number=Math.PI/

33、2.5;mc.graphics.lineStyle(2,0xff0000),mc.graphics.moveTo(55,123);for (var i:int=1; i<11; i+) y1=100+40*Math.sin(i+2.5)*Math.PI/5)-17*Math.cos(i*Math.PI/1.25);x1=55+40*Math.cos(i+2.5)*Math.PI/5)-17*Math.sin(i*Math.PI/1.25);mc.graphics.lineTo(x1,y1);mc.graphics.lineStyle(2,0x00ff00),mc.graphics.mov

34、eTo(165,124);for (i=1; i<11; i+) y1=100+34*(0.7+i%2)*Math.cos(i*Math.PI/5);x1=165+34*(0.7+i%2)*Math.sin(i*Math.PI/5);mc.graphics.lineTo(x1,y1);mc.graphics.lineStyle(2,0x0000ff),mc.graphics.moveTo(275,43);for (i=1; i<6; i+) y1=100-113*(0.5-i%2)*Math.cos(i*Math.PI/5);x1=275+113*(0.5-i%2)*Math.si

35、n(i*Math.PI/5);mc.graphics.lineTo(x1,y1);mc.graphics.lineStyle(2,0xff00ff),mc.graphics.moveTo(417.4,145);for (i=1; i<6; i+)x1=385+45*Math.sin(2*i*p)+32.4*Math.cos(3*i*p);y1=100+45*Math.cos(2*i*p)+32.4*Math.sin(3*i*p);mc.graphics.lineTo(x1,y1);mc.graphics.lineStyle(2,0x00ffff),mc.graphics.moveTo(4

36、95,43);for (i=1; i<6; i+)x1=495+33*Math.sin(2*i*p)-24*Math.sin(3*i*p);y1=100-33*Math.cos(2*i*p)-24*Math.cos(3*i*p);mc.graphics.lineTo(x1,y1);-两角和与差的三角函数公式sin()sincoscossin, sin()sincoscossincos()coscossinsin, cos()coscossinsin7穿插多角形:两个不同周期的圆叠加,其周期除公约数商的和就是叠加后的角数。var mc:Sprite= addChild(new Sprite

37、() as Sprite;var t:uint=0,x1:Number,y1:Number,p:Number=Math.PI/60;mc.graphics.lineStyle(2,0xff0000);mc.graphics.moveTo(250,300);addEventListener(Event.ENTER_FRAME,fff);function fff(e) x1=200+100*Math.sin(t*2*p)+50*Math.cos(t*3*p);y1=200+100*Math.cos(t*2*p)+50*Math.sin(t*3*p);mc.graphics.lineTo(x1,y1

38、);t<120?t=t+1:removeEventListener(Event.ENTER_FRAME,fff);var mc:Sprite= addChild(new Sprite() as Sprite;var t:uint=0,x1:Number,y1:Number,p:Number=Math.PI/40;mc.graphics.lineStyle(2,0xff0000);mc.graphics.moveTo(230,300);addEventListener(Event.ENTER_FRAME,fff);function fff(e) x1=200+100*Math.sin(t*

39、2*p)+30*Math.cos(t*5*p);y1=200+100*Math.cos(t*2*p)+30*Math.sin(t*5*p);mc.graphics.lineTo(x1,y1);t<120?t=t+1:removeEventListener(Event.ENTER_FRAME,fff);var mc:Sprite= addChild(new Sprite() as Sprite;var t:uint=0,x1:Number,y1:Number,p:Number=Math.PI/40;mc.graphics.lineStyle(2,0xff0000);mc.graphics.

40、moveTo(220,300);addEventListener(Event.ENTER_FRAME,fff);function fff(e) x1=200+100*Math.sin(t*2*p)+20*Math.cos(t*7*p);y1=200+100*Math.cos(t*2*p)+20*Math.sin(t*7*p);mc.graphics.lineTo(x1,y1);t<120?t=t+1: removeEventListener(Event.ENTER_FRAME,fff);var mc:Sprite= addChild(new Sprite() as Sprite;var

41、t:uint=0,x1:Number,y1:Number,p:Number=Math.PI/36mc.graphics.lineStyle(2,0xff0000);mc.graphics.moveTo(250,300);addEventListener(Event.ENTER_FRAME,fff);function fff(e) x1=200+100*Math.sin(t*3*p)+50*Math.cos(t*4*p);y1=200+100*Math.cos(t*3*p)+50*Math.sin(t*4*p);mc.graphics.lineTo(x1,y1); t<120?t=t+1:

42、(t=120,removeEventListener(Event.ENTER_FRAME,fff);var mc:Sprite= addChild(new Sprite() as Sprite;var t:uint=0,x1:Number,y1:Number,p:Number=Math.PI/60;mc.graphics.lineStyle(2,0xff0000);mc.graphics.moveTo(250,300);addEventListener(Event.ENTER_FRAME,fff);function fff(e) x1=200+100*Math.sin(t*4*p)+50*Ma

43、th.cos(t*5*p);y1=200+100*Math.cos(t*4*p)+50*Math.sin(t*5*p);mc.graphics.lineTo(x1,y1); t<120?t=t+1: removeEventListener(Event.ENTER_FRAME,fff);var mc:Sprite= addChild(new Sprite() as Sprite;var t:uint=0,x1:Number,y1:Number,p:Number=Math.PI/60;mc.graphics.lineStyle(2,0xff0000);mc.graphics.moveTo(2

44、40,300);addEventListener(Event.ENTER_FRAME,fff);function fff(e) x1=200+100*Math.sin(t*3*p)+40*Math.cos(t*5*p);y1=200+100*Math.cos(t*3*p)+40*Math.sin(t*5*p);mc.graphics.lineTo(x1,y1); t<120?t=t+1:removeEventListener(Event.ENTER_FRAME,fff);var mc:Sprite= addChild(new Sprite() as Sprite;var t:uint=0

45、,x1:Number,y1:Number,p:Number=Math.PI/60;mc.graphics.lineStyle(2,0xff0000);mc.graphics.moveTo(240,300);addEventListener(Event.ENTER_FRAME,fff);function fff(e) x1=200+100*Math.sin(t*5*p)+40*Math.cos(t*7*p);y1=200+100*Math.cos(t*5*p)+40*Math.sin(t*7*p);mc.graphics.lineTo(x1,y1); t<120?t=t+1:removeE

46、ventListener(Event.ENTER_FRAME,fff);var mc:Sprite= addChild(new Sprite() as Sprite;var t:uint=0,x1:Number=270,y1:Number=300;mc.graphics.lineStyle(2,0xff0000);mc.graphics.moveTo(x1,y1);addEventListener(Event.ENTER_FRAME,fff);function fff(e) x1=200+100*Math.sin(t*Math.PI/14)+70*Math.cos(t*Math.PI/7);y

47、1=200+100*Math.cos(t*Math.PI/14)+70*Math.sin(t*Math.PI/7);mc.graphics.lineTo(x1,y1);t+;if (t>28) removeEventListener(Event.ENTER_FRAME,fff);var mc:Sprite= addChild(new Sprite() as Sprite;var t:uint=0,x1:Number=250,y1:Number=300;mc.graphics.lineStyle(2,0xff0000);mc.graphics.moveTo(x1,y1);addEventL

48、istener(Event.ENTER_FRAME,fff);function fff(e) x1=200+100*Math.sin(t*Math.PI/21)+50*Math.cos(t*Math.PI/7);y1=200+100*Math.cos(t*Math.PI/21)+50*Math.sin(t*Math.PI/7);mc.graphics.lineTo(x1,y1);t+;if (t>42) removeEventListener(Event.ENTER_FRAME,fff);var mc:Sprite= addChild(new Sprite() as Sprite;var

49、 t:uint=0,x1:Number=250,y1:Number=300;mc.graphics.lineStyle(2,0xff0000);mc.graphics.moveTo(x1,y1);addEventListener(Event.ENTER_FRAME,fff);function fff(e) x1=200+100*Math.sin(t*Math.PI/28)+50*Math.cos(t*Math.PI/7);y1=200+100*Math.cos(t*Math.PI/28)+50*Math.sin(t*Math.PI/7);mc.graphics.lineTo(x1,y1);t+

50、;if (t>56) removeEventListener(Event.ENTER_FRAME,fff);var mc:Sprite= addChild(new Sprite() as Sprite;var t:uint=0,x1:Number=240,y1:Number=300;mc.graphics.lineStyle(2,0xff0000);mc.graphics.moveTo(x1,y1);addEventListener(Event.ENTER_FRAME,fff);function fff(e) x1=200+100*Math.sin(t*Math.PI/40)+40*Ma

51、th.cos(t*Math.PI/8);y1=200+100*Math.cos(t*Math.PI/40)+40*Math.sin(t*Math.PI/8);mc.graphics.lineTo(x1,y1);/(5:1>5+1=6角)t+;if (t>80) removeEventListener(Event.ENTER_FRAME,fff);var mc:Sprite= addChild(new Sprite() as Sprite;var t:uint=0,x1:Number,y1:Number,p:Number=Math.PI/90;mc.graphics.lineStyl

52、e(2,0xff0000);mc.graphics.moveTo(295,200);addEventListener(Event.ENTER_FRAME,fff);function fff(e) x1=200+80*Math.cos(t*p)+15*Math.cos(t*6*p);y1=200+80*Math.sin(t*p)+15*Math.sin(t*6*p);mc.graphics.lineTo(x1,y1); t+;if (t>180) removeEventListener(Event.ENTER_FRAME,fff);var mc:Sprite= addChild(new S

53、prite() as Sprite;var t:uint=0,x1:Number,y1:Number,p:Number=Math.PI/60;mc.graphics.lineStyle(2,0xff0000);mc.graphics.moveTo(200,80);addEventListener(Event.ENTER_FRAME,fff);function fff(e) x1=200+80*Math.sin(t*2*p)-40*Math.sin(t*3*p);y1=200-80*Math.cos(t*2*p)-40*Math.cos(t*3*p);mc.graphics.lineTo(x1,y1);t+;if (t>120) removeEventListener(Event.ENTER_FRAME,fff);var mc:Sprite= addChild(new Sprite() as Sprite;var t:uint=0,x1:Number,y1:

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论