09-21-2003, 08:08 AM
|
#16
|
|
|
Quote:
Originally posted by mlkdesign
Ilyas. Cos he's frog.
|
That's the spirit!
And I voted Kode, very sexy work  My code:
ActionScript Code:
//Mouse.hide(); e = 20; // length of the small segments of the letters // Shape of the letters letP=[{x:0,y:5*e},{x:0,y:4*e},{x:0,y:3*e},{x:0,y:2*e},{x:0,y:e}, {x:0,y:0},{x:e,y:0},{x:2*e,y:0},{x:3*e,y:0},{x:4*e,y:e},{x:4*e,y:2*e}, {x:4*e,y:3*e},{x:3*e,y:3*e},{x:2*e,y:3*e},{x:e,y:3*e},{x:0,y:3*e} ]; letO=[ {x:e,y:0},{x:2*e,y:0},{x:3*e,y:0},{x:4*e,y:e},{x:4*e,y:2*e},{x:4*e,y:3*e}, {x:4*e,y:4*e},{x:3*e,y:5*e},{x:2*e,y:5*e},{x:e,y:5*e},{x:0,y:4*e}, {x:0,y:3*e},{x:0,y:3*e},{x:0,y:1*e},{x:e,y:0} ]; letM=[ {x:0,y:5*e},{x:0,y:4*e},{x:0,y:3*e},{x:0,y:2*e},{x:0,y:e},{x:0,y:0}, {x:e,y:e},{x:2*e,y:2*e},{x:3*e,y:e},{x:4*e,y:0},{x:4*e,y:e},{x:4*e,y:2*e}, {x:4*e,y:3*e},{x:4*e,y:4*e},{x:4*e,y:5*e} ];
// the array contains all the vertices of the letters a = [] ; // the clip letters contains all the letters... this.createEmptyMovieClip("letters",-5); letters.lineStyle(10,0xffffff,30); // params of the drawLetter function: // let - letter // dx - x position // dy - y position function drawLetter(let, dx, dy) { var x=let[0].x+dx; var y=let[0].y+dy; a.push({x:x, y:y}); letters.moveTo(x,y); for (var l=1;l<let.length;l++) { var x=let[l].x+dx; var y=let[l].y+dy; a.push({x:x, y:y}); letters.lineTo(x,y); } } drawLetter(letP,80,150); drawLetter(letO,230,150); drawLetter(letM,380,150);
l=a.length;
// params of the drawArc function: // p1 - starting point // p2 - ending point // n - number of arcs // s - number of intermediary points MovieClip.prototype.drawArc = function(p1,p2,n,s) { this.clear(); for (var p=0;p<n;p++){ this.moveTo(p1.x,p1.y); this.lineStyle(random(3),0xffffff,random(50)+50); var dx=p2.x-p1.x; var dy=p2.y-p1.y; for (var q=1;q<s;q++) { var px=p1.x+q*dx/s + random(30)-15; var py=p1.y+q*dy/s + random(30)-15; this.lineTo(px,py); } this.lineTo(p2.x,p2.y); } }
// params of the createArc function: // n - number of arcs // s - number of intermediary points function createArc(n, s) { i++ var arc = this.createEmptyMovieClip("a"+i,i); // random starting point, ending point selected in the a array arc.ind1 = random(l-1)+1; arc.ind2 = random(l-1)+1; // random direction arc.dir1 = random(2) ? 1 : -1 ; arc.dir2 = random(2) ? 1 : -1 ; arc.onEnterFrame=function() { // create an arc between the current starting and ending points this.drawArc(a[this.ind1],a[this.ind2],n,s); // change those points according to direction this.ind1+=this.dir1; this.ind2+=this.dir2; if (this.ind1<=0 || this.ind1>=l-1) this.dir1*=-1; if (this.ind2<=0 || this.ind2>=l-1) this.dir2*=-1; this._alpha--; if (this._alpha<1) { delete this.onEnterFrame; this.removeMovieClip(); } } } interval = setInterval(this,"createArc",random(500)+1000,2,7);
I tried to comment it (you need a black background).
__________________
Last smoke by Ilyas : yesterday at 11:45 PM.
|
|
|
09-21-2003, 09:41 AM
|
#17
|
|
|
Well here is my blocky code
ActionScript Code:
this.stop(); MovieClip.prototype.OldCreateEmptyMovieClip = MovieClip.prototype.createEmptyMovieClip; MovieClip.prototype.createEmptyMovieClip = function(naam, depth, X, Y) { newMc = this.OldCreateEmptyMovieClip(naam, depth); newMc._y = Y; newMc._x = X; return this.newMc; }; MovieClip.prototype.makeCircle = function(theColor, theSize, lineColor, thickness) { this.beginFill(theColor); this.lineStyle(thickness, lineColor, 100); for (i=0; i<37; i++) { this.rotation += 10; this.Xdistance = Math.sin(this.rotation*Math.PI/180)*theSize; this.Ydistance = Math.cos(this.rotation*Math.PI/180)*theSize; this[i == 0 ? "moveTo" : "lineTo"](this.Xdistance, this.Ydistance); } this.endFill(); return this; }; MovieClip.prototype.draw = function(theColor, lineColor, thickness) { this.lineStyle(thickness, lineColor, 100); this.beginFill(theColor); for (g=3; g<arguments.length; g++) { this[arguments[g].c ? "lineTo" : "moveTo"](arguments[g].x, arguments[g].y); } this.endFill(); return this; }; //------------------------------------------------------------------------------- createEmptyMovieClip("BG_mc", 0, 0, 0).draw(0x000000, undefined, undefined, {c:1, x:0, y:Stage.height}, {c:1, x:Stage.width, y:Stage.height}, {c:1, x:Stage.width, y:0}); createEmptyMovieClip("holder_mc", 1, Stage.width/2, Stage.height/2+5).draw(0x999999, undefined, undefined, {c:1, x:50, y:0}, {c:1, x:50, y:0}, {c:1, x:40, y:20}, {c:1, x:10, y:40}, {c:1, x:20, y:160}, {c:1, x:50, y:170}, {c:1, x:70, y:190}, {c:1, x:0, y:190}, {c:1, x:0, y:0}).draw(0xcccccc, undefined, undefined, {c:1, x:-50, y:0}, {c:1, x:-50, y:0}, {c:1, x:-40, y:20}, {c:1, x:-10, y:40}, {c:1, x:-20, y:160}, {c:1, x:-50, y:170}, {c:1, x:-70, y:190}, {c:1, x:0, y:190}, {c:1, x:0, y:0}); createEmptyMovieClip("glassRings_mc", 2, Stage.width/2, Stage.height/2+65).draw(undefined, 0x66ccff, 10, {c:0, x:-35, y:0}, {c:1, x:35, y:0}, {c:0, x:-45, y:20}, {c:1, x:45, y:20}, {c:0, x:-35, y:40}, {c:1, x:35, y:40}, {c:0, x:-45, y:60}, {c:1, x:45, y:60}, {c:0, x:-35, y:80}, {c:1, x:35, y:80}).draw(undefined, 0xffffff, 5, {c:0, x:-35, y:-2}, {c:1, x:25, y:-2}, {c:0, x:-45, y:18}, {c:1, x:35, y:18}, {c:0, x:-35, y:38}, {c:1, x:25, y:38}, {c:0, x:-45, y:58}, {c:1, x:35, y:58}, {c:0, x:-35, y:78}, {c:1, x:25, y:78}); createEmptyMovieClip("ballBG_mc", 3, Stage.width/2, Stage.height/2-50).makeCircle(0x000000, 80); createEmptyMovieClip("mask_mc", 4, Stage.width/2, Stage.height/2-50).makeCircle(0x000000, 80); createEmptyMovieClip("electric_mc", 5, Stage.width/2, Stage.height/2-50); createEmptyMovieClip("smallBallGlow_mc", 6, Stage.width/2, Stage.height/2-50).makeCircle(0x0099ff, 17)._alpha = 50; createEmptyMovieClip("smallBall_mc", 7, Stage.width/2, Stage.height/2-50).makeCircle(0xcccccc, 15); createEmptyMovieClip("smallBallShine_mc", 8, Stage.width/2-6, Stage.height/2-56).makeCircle(0xeeeeee, 5); createEmptyMovieClip("bigBall_mc", 9, Stage.width/2, Stage.height/2-50).makeCircle(0x66ccff, 80, 0x0066ff, 10); createEmptyMovieClip("bigBallShine_mc", 10, Stage.width/2-40, Stage.height/2-90).makeCircle(0x66ccff, 20); electric_mc.setMask(mask_mc); //------------------------------------------------------------------------------- onEnterFrame = function () { var i = random(40)+10; bigBall_mc._alpha = i; bigBallShine_mc._alpha = i; glassRings_mc._alpha = random(40)+50; }; for (q=0; q<15; q++) { newBolt_mc = electric_mc.OldCreateEmptyMovieClip("bolt"+q+"_mc", q); newBolt_mc.rotation = random(360); newBolt_mc.dir = random(2); newBolt_mc.onEnterFrame = function() { this.dir ? this.rotation += 5 : this.rotation -= 5; this.clear(); this.moveTo(0, 0); for (p=1; p<10; p++) { this.X = random(20)+(Math.sin(this.rotation*Math.PI/180)*Math.sqrt(p)*27)-10; this.Y = random(20)+(Math.cos(this.rotation*Math.PI/180)*Math.sqrt(p)*27)-10; random(25) ? this.lineStyle(0, 0x0099ff, 100) : this.lineStyle(0, 0xffffff, 100); this.lineTo(this.X, this.Y); } random(100) ? undefined : this.dir=!this.dir; }; }

__________________
.....
|
|
|
09-21-2003, 11:53 AM
|
#18
|
|
|
impressive.
__________________
This message will self destruct.
|
|
|
09-21-2003, 11:48 PM
|
#21
|
|
|
wow, master64's is pretty cool (for some reason it doesn't show up on the net for me but now i see it in flash) my code is probably the ugliest (shouldn't have used so many gradients) but hey, what can i do?
ActionScript Code:
Mouse.hide(); /*** create background ***/ _root.createEmptyMovieClip("bg", ++d); bg.lineStyle(0, 0x000000, 0); bg.beginFill(0x000000, 100); bg.lineTo(Stage.width, 0); bg.lineTo(Stage.width, Stage.height); bg.lineTo(0, Stage.height); bg.lineTo(0, 0); bg.endFill(); /*** create base ***/ thickness = 10; bcolors = [0xcccccc, 0x000000]; balphas = [100, 100]; bratios = [0, 255]; bmatrix = {matrixType:"box", x:Stage.width/2-20, y:y/4, w:30, h:y/2, r:0}; _root.createEmptyMovieClip("base", ++d); base.lineStyle(1, 0x333333, 0); base.beginGradientFill("linear", bcolors, balphas, bratios, bmatrix); base.moveTo(Stage.width/2-thickness, Stage.height); base.lineTo(Stage.width/2+thickness, Stage.height); base.lineTo(Stage.width/2+thickness, Stage.height/2); base.lineTo(Stage.width/2-thickness, Stage.height/2); base.lineTo(Stage.width/2-thickness, Stage.height); base.endFill(); /*** create "sphere" ***/ x = Stage.width/2; y = Stage.height/2; R = 50; a = R*0.4086; b = R*0.7071; colors = [0xFFFFFF, 0x000000]; alphas = [100, 100]; ratios = [0, 255]; gradX = gradY=57; matrix = {matrixType:"box", x:x-gradX, y:y-gradY, w:100, h:100, r:0}; _root.createEmptyMovieClip("circle", ++d); circle.lineStyle(1, 0x000000, 0); circle.beginGradientFill("radial", colors, alphas, ratios, matrix); circle.moveTo(x-R, y); circle.curveTo(x-R, y-a, x-b, y-b); circle.curveTo(x-a, y-R, x, y-R); circle.curveTo(x+a, y-R, x+b, y-b); circle.curveTo(x+R, y-a, x+R, y); circle.curveTo(x+R, y+a, x+b, y+b); circle.curveTo(x+a, y+R, x, y+R); circle.curveTo(x-a, y+R, x-b, y+b); circle.curveTo(x-R, y+a, x-R, y); circle.endFill(); /*** create magnet ***/ mx = 0; my = 0; mR = 15; ma = mR*0.4086; mb = mR*0.7071; _root.createEmptyMovieClip("mag", 1000); mag.lineStyle(14, 0xff0000, 100); mag.moveTo(mx+10, my+mR); mag.lineTo(mx, my+mR); mag.curveTo(mx-ma, my+mR, mx-mb, my+mb); mag.curveTo(mx-mR, my+ma, mx-mR, my); mag.curveTo(mx-mR, my-ma, mx-mb, my-mb); mag.curveTo(mx-ma, my-mR, mx, my-mR); mag.lineTo(mx+10, my-mR); mag.createEmptyMovieClip("white", 1001); mag.white.lineStyle(1, 0xaaaaaa, 0); mag.white.beginFill(0xaaaaaa, 100); mag.white.moveTo(mx+10, my-mR+7); mag.white.lineTo(mx+20, my-mR+7); mag.white.lineTo(mx+20, my-mR-7); mag.white.lineTo(mx+10, my-mR-7); mag.white.lineTo(mx+10, my-mR+7); mag.white.endFill(); mag.white.beginFill(0xaaaaaa, 100); mag.white.moveTo(mx+10, my+mR+7); mag.white.lineTo(mx+20, my+mR+7); mag.white.lineTo(mx+20, my+mR-7); mag.white.lineTo(mx+10, my+mR-7); mag.white.lineTo(mx+10, my+mR+7); mag.white.endFill(); /*** ELECTRICITY ***/ MovieClip.prototype.moveLght = function(iterations, intensity, thresh) { this.onEnterFrame = function() { dist = Math.sqrt((mag._x-this._x)*(mag._x-this._x)+(mag._y-this._y)*(mag._y-this._y))/(iterations+1); mag.ang = Math.atan2(y-mag._y, x-mag._x); mag._rotation = mag.ang*180/Math.PI; mag._x = _xmouse; mag._y = _ymouse; if (dist<thresh) { intens = dist>10 ? intensity/(dist/10) : intensity; intens = (intens*intens)/20; alpha = intens//+10; this.clear(); this.lineStyle(1, 0xffff00, alpha); this.moveTo(0, 0); for (i=1; i<=iterations; i++) { this.lineTo(i*dist, (Math.random()*intens)-intens/2); } this.lineTo(i*dist, 0); ang = Math.atan2(mag._y-this._y, mag._x-this._x); this._rotation = ang*180/Math.PI; } else { this.clear(); this.lineStyle(1, 0xffff00, alpha); } }; }; for (num=1; num<=5; num++) { name = "light"+num; _root.createEmptyMovieClip(name, ++d); _root[name]._x = x; _root[name]._y = y; _root[name].moveLght(5, num*10, 45); }
__________________
|
|
|
09-22-2003, 12:27 PM
|
#23
|
|
|
Ok. Here's my code:
ActionScript Code:
var origin = {x:Stage.width/2, y:Stage.height/2}; var radius = {r:120, b:20, s:20}; var speed = Math.PI/45; var speedmax = Math.PI/45; var lines = 2; var strength = 4; var total = 7; this.createEmptyMovieClip("pos", total); pos.moveTo(radius.b, 0); pos.beginGradientFill("radial", [0xCCCCCC, 0x999999], [100, 100], [0, 255], {matrixType:"box", x:-radius.b-radius.b/2, y:-radius.b-radius.b/2, w:radius.b*2, h:radius.b*2, r:0}); for (var radians = 0; radians<Math.PI*2; radians += Math.PI/180) { pos.lineTo(Math.cos(radians)*radius.b, Math.sin(radians)*radius.b); } pos.endFill(); pos._x = origin.x; pos._y = origin.y; for (var depth = 0; depth<total; depth++) { var neg = this.createEmptyMovieClip("neg"+depth, depth); neg.createEmptyMovieClip("line", 0); neg.createEmptyMovieClip("ball", 1); neg.ball.moveTo(radius.s, 0); neg.ball.beginGradientFill("radial", [0xCCCCCC, 0x999999], [100, 100], [0, 255], {matrixType:"box", x:-radius.s-radius.s/2, y:-radius.s-radius.s/2, w:radius.s*2, h:radius.s*2, r:0}); for (var radians = 0; radians<Math.PI*2; radians += Math.PI/180) { neg.ball.lineTo(Math.cos(radians)*radius.s, Math.sin(radians)*radius.s); } neg.ball.endFill(); neg._x = origin.x; neg._y = origin.y; neg.radians = Math.PI*2*depth/total; neg.onEnterFrame = function() { this.radians += speed; var cos = Math.cos(this.radians); var sin = Math.sin(this.radians); this.ball._x = cos*radius.r; this.ball._y = sin*radius.r/2; this.ball._width = radius.s+sin*radius.s/2; this.ball._height = radius.s+sin*radius.s/2; this.swapDepths(sin*total+total); var xstart = cos*radius.b; var ystart = sin*radius.b/2; var xend = cos*radius.r; var yend = sin*radius.r/2; var xdiff = xend-xstart; var ydiff = yend-ystart; this.line.clear(); for (var index = 0; index<lines; index++) { this.line.lineStyle(1, 0x000000, sin*20+(80-index*20)); this.line.moveTo(xstart, ystart); for (var seg = 1; seg<strength; seg++) { var x = -strength/2+Math.random()*strength+xdiff*seg/strength+xstart; var y = -strength/2+Math.random()*strength+ydiff*seg/strength+ystart; this.line.lineTo(x, y); } this.line.lineTo(xend, yend); } }; } this.onMouseMove = function() { var diff = this._xmouse-origin.x; speed = speedmax*diff/origin.x; };
And I voted for yours, Ilyas. 
|
|
|
09-22-2003, 03:45 PM
|
#24
|
|
Puttin' the 'utility' back into 'futility'
|
|
ah...nice kode, there code...er...kode....
I see you used that elusive beginGradientFill function, good job 
__________________
...teeming with souls shall it ever be...
|
|
|
09-23-2003, 03:12 AM
|
#28
|
|
Nabbed, then stabbed Phil in the back!
|
|
Quote:
Originally posted by asphaltcowboy
lol, sorry guys, posted but forgot to actually vote! lmao, I'm such a muppet
|
omg, I could follow this kid around and just laugh all day. I fall out of my chair about once a day reading this kind of nonsense.
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is On
|
|
|
All times are GMT -4. The time now is 08:24 PM.
|
|