# My first node-garden

**URL:** <https://forum.kirupa.com/t/my-first-node-garden/15363>\
**Category:** random\
**Created:** [March 13, 2003, 12:42pm UTC](https://forum.kirupa.com/t/my-first-node-garden/15363 "2003-03-13T12:42:24Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![eilsoe](https://avatars.discourse-cdn.com/v4/letter/e/9fc348/32.png) [@eilsoe](https://forum.kirupa.com/u/eilsoe)\
**Post date:** [March 13, 2003, 12:42pm UTC](https://forum.kirupa.com/t/my-first-node-garden/15363/1 "2003-03-13T12:42:24Z")

</div>

[http://www.avalon-rev.dk/junk/nodes/nodegarden.html](http://www.avalon-rev.dk/junk/nodes/nodegarden.html)

pretty basic so far… can’t wait to dive deeper into this =)

Just refresh the page for a new “garden”.

(remember it takes a while to create the lot… :sure:

it takes about 3 seconds on my com at work (where I am now)…

hm… maybe I’ll try making this in 3d!!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 13, 2003, 12:52pm UTC](https://forum.kirupa.com/t/my-first-node-garden/15363/2 "2003-03-13T12:52:19Z")

</div>

That’s nice. I think I wrote something like this in C a year ago, only it was to make a tree. You had a straight line for the trunk, then it was just a random thing for the branches, like it could have either two, one or no brnches, and each of those could have two, one or no branches from that… It was really cool watching it draw it on screen.

And we played around with it a bit, and made bonsai C trees. 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 13, 2003, 1:24pm UTC](https://forum.kirupa.com/t/my-first-node-garden/15363/3 "2003-03-13T13:24:07Z")

</div>

_hiccup_

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 13, 2003, 1:26pm UTC](https://forum.kirupa.com/t/my-first-node-garden/15363/4 "2003-03-13T13:26:58Z")

</div>

oh my gosh! That’s so cool! awesome maan!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 13, 2003, 1:30pm UTC](https://forum.kirupa.com/t/my-first-node-garden/15363/5 "2003-03-13T13:30:15Z")

</div>

hm… I may do a tut… if I can ever get my lazy arse out of the seat and DO it… :-\

if ppl even want to see a tut on this…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 13, 2003, 1:58pm UTC](https://forum.kirupa.com/t/my-first-node-garden/15363/6 "2003-03-13T13:58:45Z")

</div>

Hey eilsoe,  
The animation looks great! I’m sure people would be interested in seeing a tutorial on this - I know I am hehe.

Cheers!  
Kirupa :ub:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 13, 2003, 2:40pm UTC](https://forum.kirupa.com/t/my-first-node-garden/15363/7 "2003-03-13T14:40:32Z")

</div>

awsome work!  
really cool

(1.5 seconds here)

Creatures

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 13, 2003, 3:58pm UTC](https://forum.kirupa.com/t/my-first-node-garden/15363/8 "2003-03-13T15:58:27Z")

</div>

It took no time at all here - great work man! It looks great!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 13, 2003, 5:25pm UTC](https://forum.kirupa.com/t/my-first-node-garden/15363/9 "2003-03-13T17:25:19Z")

</div>

for those who want’s to study it independently, use this:

[AS]  
total=70;  
maxdist=100;  
createlines=function(){  
nodearray=[];  
for(i=0;i\<=total;i++){  
node=attachMovie(“node”,“newnode”+i,i);  
nodearray\*=node;  
node.\_x=random(550);  
node.\_y=random(400);  
}  
for(a=0;a\<nodearray.length;a++){  
firstnode=nodearray[a];  
for(b=0;b\<nodearray.length;b++){  
secondnode=nodearray[b];  
dx=firstnode.\_x-secondnode.\_x;  
dy=firstnode.\_y-secondnode.\_y;  
dist=Math.sqrt((dx_dx)+(dy_dy));  
if(dist\<maxdist){  
c++;  
\_root.createEmptyMovieClip(“line”+c,c+total);  
newlines=this[“line”+c];  
newlines.lineStyle(0,0xFFFFFF,(100-dist));  
newlines.moveTo(firstnode.\_x,firstnode.\_y);  
newlines.lineTo(secondnode.\_x,secondnode.\_y);  
}  
}  
}  
}  
createlines();  
[/AS]

Just make a MC of the node you wanna use, and set the linkage to actionscript in the prop panel, use the link name “ **node** ”.

the code goes in the first frame of the main timeline…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 13, 2003, 5:48pm UTC](https://forum.kirupa.com/t/my-first-node-garden/15363/10 "2003-03-13T17:48:25Z")

</div>

You know what - looking at that like is trying to read chineese.

I am just going to take your word for it dude. 😉

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 13, 2003, 5:57pm UTC](https://forum.kirupa.com/t/my-first-node-garden/15363/11 "2003-03-13T17:57:53Z")

</div>

I’ll make a tut sooner or later 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 13, 2003, 6:04pm UTC](https://forum.kirupa.com/t/my-first-node-garden/15363/12 "2003-03-13T18:04:18Z")

</div>

doesn’t bit-101 already have a tutorial on this?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 13, 2003, 8:17pm UTC](https://forum.kirupa.com/t/my-first-node-garden/15363/13 "2003-03-13T20:17:15Z")

</div>

Wow, node gardens are fun to play with!!!

Here is what I came up with…

> **[Save BIG with $9.99 .COMs from GoDaddy!](http://www.lostinbeta.com/experimental/nodeGarden.html)**
>
> Get your own corner of the Web for less! Register a new .COM for just $9.99 for the first year and get everything you need to make your mark online — website builder, hosting, email, and more.

Here is my code…  
[AS]numNodes = 25;  
nodez = [];  
MovieClip.prototype.ranMove = function() {  
this.\_x += (this.newX-this.\_x)/this.speed;  
this.\_y += (this.newY-this.\_y)/this.speed;  
if (Math.round(this.\_y) == Math.round(this.newY) && Math.round(this.\_x) == Math.round(this.newX)) {  
this.newX = Math.round(Math.random()_550);  
this.newY = Math.round(Math.random()400);  
this.speed = Math.ceil(Math.random()(10-2)+2);  
}  
};  
for (i=0; i\<numNodes; i++) {  
node = attachMovie(“node”, “n”+i, i);  
nodez_ = node;  
node.\_xscale = node.\_yscale=Math.random()_100+50;  
node.onEnterFrame = ranMove;  
}  
minDist = 120;  
\_root.onEnterFrame = function() {  
var i, j, nodeA, nodeB, dx, dy, dist, alpha;  
clear();  
for (i=0; i\<nodez.length-1; i++) {  
nodeA = nodez_;  
for (j=i+1; j\<nodez.length; j++) {  
nodeB = nodez[j];  
dx = nodeB.\_x-nodeA.\_x;  
dy = nodeB.\_y-nodeA.\_y;  
dist = Math.sqrt(dx_dx+dy_dy);  
if (dist\<minDist) {  
alpha = 100-dist/minDist\*100;  
lineStyle(1, 0xffffff, alpha);  
moveTo(nodeA.\_x, nodeA.\_y);  
lineTo(nodeB.\_x, nodeB.\_y);  
}  
}  
}  
};[/AS]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 13, 2003, 8:24pm UTC](https://forum.kirupa.com/t/my-first-node-garden/15363/14 "2003-03-13T20:24:45Z")

</div>

Nodes are like the coolest flash thing ever  
as soon as I’m done learning AS that’s what I want to expirement with, they are both visually and mathematically appealing.

A tut would definately be awesome!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 13, 2003, 9:01pm UTC](https://forum.kirupa.com/t/my-first-node-garden/15363/15 "2003-03-13T21:01:17Z")

</div>

> \*Originally posted by lostinbeta \*  
> \*\*Wow, node gardens are fun to play with!!!

Here is what I came up with…

[http://www.lostinbeta.com/experimental/nodeGarden.html](http://www.lostinbeta.com/experimental/nodeGarden.html)

Here is my code… \*\*

hey it looks awsome can u explain me the code? =/ perhaps?

Creatures
