Bezzer
September 5, 2002, 6:13am
1
I was playing around with api and I came up with this, kinda looks like the pictures where they leave the camera shutter open
_root.createEmptyMovieClip("bob",0);
while(i<40){
bob.duplicateMovieClip("bob"+i,i)
eval("bob"+i).moveTo(Math.random()*550,Math.random()*400);
eval("bob"+i).lineStyle(Math.random()*3,Math.random() * 255 << 16 | Math.random() * 255 << 8 | Math.random() * 255,Math.random()*50+50);
++i;
}
onEnterFrame = function(){
for(x=0;x<40;++x){
eval("bob"+x).clear()
eval("bob"+x).moveTo(Math.random()*550,Math.random()*400);
eval("bob"+x).lineStyle(Math.random()*3,Math.random() * 225 << 16 | Math.random() * 255 << 8 | Math.random() * 255,Math.random()*100);
//eval("bob"+x).lineTo(_xmouse,_ymouse);
eval("bob"+x).curveTo(_xmouse,_ymouse,(550/2),50);
}
}
Yeah just think it looks cool…hehe
system
September 5, 2002, 6:32am
2
Very neato. Although you should add
_root.createEmptyMovieClip(“bob”, 1);
to the beginning of that code. That is…if you are posting that for copy and paste.
system
September 5, 2002, 6:33am
3
hehe ooops i forgot to paste that part…oh well hehe
system
September 11, 2002, 7:40am
4
Hey Bezzer, you could propose this for the 25-line Actionscript contest !
pom :asian:
system
September 11, 2002, 7:41am
5
Hmm, that is a good idea!
system
September 12, 2002, 11:18am
6
By the way, it didn’t work until I put createEmptyMovieClip(“bob”,-1). Which is logical because you duplicate your first clip at depth 0.
pom :asian:
system
September 12, 2002, 11:23am
7
yeah that was what i was trying to make it for hehe…but i dun think i’ll enter…i’ve seen the other peoples stuff…To good for me
hrmmm i’ll look into the thing u had to change…i think i should start off at 1
system
September 12, 2002, 11:51am
8
Don’t be shy, man! But it’s true that this Russian guy just made a 3D dog in 21 lines, and I don’t how anyone can beat that…
pom :asian:
system
September 12, 2002, 11:55am
9
wow which entry is that? hehe i wanna see the 3d dog…
system
September 12, 2002, 12:11pm
10
One of the last ones, check it on the forums. From deliMIter. That guy is totally amazing, absolutely brilliant. But don’t look at the source, it’s worse than Chinese
pom :asian:
system
September 12, 2002, 3:57pm
11
WOW, that delimeter guy is amazing as well. Although I think his code was too long to be in the contest…not sure how you count the lines though.
Anyways, I love how he uses the “?:” if/else statement. It is so much more efficient. I use it in Javascript all the time.
I pretty much understood his code up to here…
function fromAtoB(A, B) {
// the next block is one line //
if (typeof (A) == “movieclip”) {
for (var i = 1; i<(iLimit=Math.round(Math.sqrt((A.X-B.X)(A.X-B.X)+(A.Y-B.Y) (A.Y-B.Y)+(A.Z-B.Z)(A.Z-B.Z))/((A._radius+B.radius)/4))); i++) {
createClip(A.name+" "+i+" "+B._name, ++_depth, Math.round((A._color & 0xFF) (iLimit-i)/iLimit) | Math.round(((A._color >> 8) & 0xFF)(iLimit-i)/iLimit) << 8 | Math.round(((A._color >> 16) & 0xFF) (iLimit-i)/iLimit) << 16 | Math.round((B._color & 0xFF)i/iLimit) | Math.round(((B._color >> 8) & 0xFF)i/iLimit) << 8 | Math.round(((B._color >> 16) & 0xFF)i/iLimit) << 16, (A._radius (iLimit-i)/iLimit+B._radius i/iLimit)2 Math.pow(Math.abs(i-iLimit/2), 1/3)/iLimit+10, {X:_zx=A.X+i (B.X-A.X)/iLimit, Y:_zy=A.Y+i*(B.Y-A.Y)/iLimit, Z:_zz=A.Z+i*(B.Z-A.Z)/iLimit, R:Math.sqrt(_zx*_zx+_zy*_zy+_zz*_zz)}, true);
}
}
// end of block //
}
Then it all went downhill from there…haha.
system
September 13, 2002, 3:27am
12
hrmm i can only see the lightnening one and the mouse fire thing from him…can u post a link to his dog please?
system
September 13, 2002, 3:35am
13
I had a look at some of urs pom…or at least i think there urs…hehe
There really good
system
September 13, 2002, 4:06am
14
He called it a molecular alcoholic pet…haha. It is incredible though. To think that nothing was drawin the making of this. His code is astounding too.
http://www.station4net.com/flashfx/057-25-lines.html
There is a link to it.
system
September 13, 2002, 10:16am
15
Thanks Bezzer
And about the line count, the worse thing is that his code is perfectly valid. You see, with MX, lots of functions create, attach or dulpicate an object, and they also return a reference to that object. So for instance, you could write:
_root.createEmptyMovieClip("holder",-1);
_root.holder.createTextField("myText",0,0,0,20,10).
_root.holder.myText.text="Flash rocks";
But you could also do it like:
_root.createEmptyMovieClip("holder",-1).createTextField("myText",0,0,0,20,10).text="Flash rocks";
You see how it works?
pom
system
September 13, 2002, 11:04am
16
didn’t know you could do that…thats a pretty nice trick…gotta love dot syntax
system
September 13, 2002, 1:59pm
17
i’ve been trying to make my code like that… i want to make these lines
eval("bob"+x).clear()
eval("bob"+x).moveTo(Math.random()*550,Math.random()*400);
eval("bob"+x).lineStyle(Math.random()*50,Math.random() * 225 << 16 | Math.random() * 255 << 8 | Math.random() * 255,Math.random()*100);
eval("bob"+x).curveTo(_xmouse,_ymouse,(419.6/2),50);
into this…
eval("bob"+x).clear().moveTo(Math.random()*550,Math.random()*400).lineStyle(Math.random()*50,Math.random() * 225 << 16 | Math.random() * 255 << 8 | Math.random() * 255,Math.random()*100).curveTo(_xmouse,_ymouse,(419.6/2),50);
but it doesn’t seem to work…i think im not understanding things right…
system
September 13, 2002, 3:33pm
18
Wow, gotta love that confuscated (? I think this is the word) code.
Hey Bezzer:
_root.createEmptyMovieClip("<B>holder</B>",-1);
_root.<B>holder</B>.createTextField(“myText”,0,0,0,20,10).
_root.<B>holder</B>.myText.text=“Flash rocks”;
See how the name of the created movie clip is used it all of the other statements. It is written with a locator (aka _root). Now if I understand Ilyas correctly, instead of typing _root.holder all the time you can just attach it to the end of the createEmptyMovieClip command.
I noticed the code you have doesn’t contain the locator, possibly that is why it is not working.
system
September 13, 2002, 3:36pm
19
well eval(“bob”+x) is th locator…it gives it the name of a duplicated movie… so yeah i dont know why it doesn’t work…
system
September 13, 2002, 3:38pm
20
Maybe I should have specified, oops:) I meant the locator as in _root or _parent. I think that might be when it works.