最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
flash AS3.0代码打造逼真涟漪
时间:2022-07-02 17:00:18 编辑:袖梨 来源:一聚教程网
详细代码:
stage.frameRate=80;
function init(x1:Number,y1:Number) {
var mc:MovieClip=new MovieClip();
addChildAt(mc,1);
mc.x=x1;
mc.y=y1;
mc.graphics.lineStyle(0.5,0xbbffff,0.6);
mc.graphics.drawEllipse(-1,-0.3,2,0.6);
mc.addEventListener(Event.ENTER_FRAME,frame);
var v0=0.5+0.3*Math.random();
function frame(e) {
mc.scaleX=mc.scaleY+=v0;
mc.alpha>0?mc.alpha-=0.02:[mc.removeEventListener(Event.ENTER_FRAME,frame),removeChild(mc),mc=null];
}
}
function xiayu() {
var timer:Timer=new Timer(200,2);
timer.addEventListener(TimerEvent.TIMER,onTimer);
var mc:MovieClip=new MovieClip();
mc.graphics.beginFill(0xbbffff,0.8);
mc.graphics.drawEllipse(-0.5,-2,1,4);
addChildAt(mc,1);
mc.scaleX=mc.scaleY=0.7+0.3*Math.random();
var x0=mc.x=50+Math.random()*450;
mc.y=-10-20*Math.random();
var y0=30+350*Math.random();
mc.addEventListener(Event.ENTER_FRAME,frameB);
function frameB(e) {
if (mc.y
mc.y+=5;
} else {
mc.removeEventListener(Event.ENTER_FRAME,frameB);
removeChild(mc);
mc=null;
init(x0,y0);
timer.start();
}
}
function onTimer(e) {
init(x0,y0);
}
}
var t:Timer=new Timer(100,0);
t.addEventListener(TimerEvent.TIMER,onT);
t.start();
function onT(e) {
xiayu();
xiayu();
}
var tu:Hehua=new Hehua();
addChild(tu);
var kj:MovieClip=new Kj ;
addChild(kj);
function init(x1:Number,y1:Number) {
var mc:MovieClip=new MovieClip();
addChildAt(mc,1);
mc.x=x1;
mc.y=y1;
mc.graphics.lineStyle(0.5,0xbbffff,0.6);
mc.graphics.drawEllipse(-1,-0.3,2,0.6);
mc.addEventListener(Event.ENTER_FRAME,frame);
var v0=0.5+0.3*Math.random();
function frame(e) {
mc.scaleX=mc.scaleY+=v0;
mc.alpha>0?mc.alpha-=0.02:[mc.removeEventListener(Event.ENTER_FRAME,frame),removeChild(mc),mc=null];
}
}
function xiayu() {
var timer:Timer=new Timer(200,2);
timer.addEventListener(TimerEvent.TIMER,onTimer);
var mc:MovieClip=new MovieClip();
mc.graphics.beginFill(0xbbffff,0.8);
mc.graphics.drawEllipse(-0.5,-2,1,4);
addChildAt(mc,1);
mc.scaleX=mc.scaleY=0.7+0.3*Math.random();
var x0=mc.x=50+Math.random()*450;
mc.y=-10-20*Math.random();
var y0=30+350*Math.random();
mc.addEventListener(Event.ENTER_FRAME,frameB);
function frameB(e) {
if (mc.y
mc.y+=5;
} else {
mc.removeEventListener(Event.ENTER_FRAME,frameB);
removeChild(mc);
mc=null;
init(x0,y0);
timer.start();
}
}
function onTimer(e) {
init(x0,y0);
}
}
var t:Timer=new Timer(100,0);
t.addEventListener(TimerEvent.TIMER,onT);
t.start();
function onT(e) {
xiayu();
xiayu();
}
var tu:Hehua=new Hehua();
addChild(tu);
var kj:MovieClip=new Kj ;
addChild(kj);
相关文章
- 黑神话悟空1.0.12.16581版本更新公告 12-27
- 光遇12.27红石碎片在哪里 12-27
- 无限暖暖翩翩愿飞去怎么样 无限暖暖翩翩愿飞去能力套装介绍 12-27
- 无限暖暖流星绚烂时怎么样 无限暖暖流星绚烂时套装介绍 12-27
- 无限暖暖1.1版本流星季怎么玩 无限暖暖1.1流星季版本活动介绍 12-27
- 第五人格孽蜥耶梦加得怎么样 第五人格孽蜥耶梦加得稀世时装介绍 12-27