대화
y=f(x)님의 글에서 이어진 답글 0개
★ 마우스에서 흩어지는 색색의 동그라미 createEmptyMovieClip("fxMc", 100000); MovieClip.prototype.c = function(x, y, r) { var c1 = r*(Math.SQRT2-1); var c2 = r*Math.SQRT1_2; this.moveTo(x+r, y); this.curveTo(x+r, y+c1, x+c2, y+c2); this.curveTo(x+c1, y+r, x, y+r); this.curveTo(x-c1, y+r, x-c2, y+c2); this.curveTo(x-r, y+c1, x-r, y); this.curveTo(x-r, y-c1, x-c2, y-c2); this.curveTo(x-c1, y-r, x, y-r); this.curveTo(x+c1, y-r, x+c2, y-c2); this.curveTo(x+r, y-c1, x+r, y); }; fxMc.circles = []; fxMc.circles2 = []; fxMc.onEnterFrame = function() { this.circles.pop(); this.circles.unshift(new fpartic(Math.random()*6.283, random(16777216))); this.clear(); for (var i = 0; i<16; i++) { var n = this.circles[i]; n.x += n.vx *= 0.8; n.y += n.vy *= 0.8; this.beginFill(n.c, n.a -= 6.25); this.c(n.x, n.y, 2); this.endFill(); } for (i = 0; i<this.circles2.length; i++) { var n = this.circles2[i]; n.x += n.vx *= 0.8; n.y += n.vy *= 0.8; this.beginFill(n.c, n.a -= 6.25); this.c(n.x, n.y, 2); this.endFill(); if(n.a<=0){ this.circles2.splice(i,1); i--; } } }; fxMc.onMouseDown = function() { var rc = random(16777216); for (var i = 0; i<2; i += 0.1) { fxMc.circles2.unshift(new fpartic(i*Math.PI, rc)); } }; for (i=0; i<16; i++) { fxMc.circles.unshift(new fpartic(Math.random()*6.283, random(16777216))); } function fpartic(dir, c) { this.vx = Math.cos(dir)*10; this.vy = Math.sin(dir)*10; this.x = _root._xmouse; this.y = _root._ymouse; this.c = c; this.a = 100; } 주의사항 : 이 액션을 쓸때는 절대로 getNextHighestDepth()를 쓰지 말것. 어떤가요?
하면 이 대화에 답할 수 있어요.