[FMX2004] Need help with blob-like effect

Hi everyone, the other day I was browsing the net and came upon this site Neave.com, which has a really cool blob-like borders effect. I mailed the guy and he directed me to the [URL=http://www.neave.com/lab/neave_site_fla.zip]actionscript source code. Now the problem was that this was my first time looking at ActionScript code (heck… I didn’t even know it existed!), so his code looks very cryptic for a total newbie like me.

I really wanted to learn how to accomplish this effect, so I decided to search the net for tutorials and instead of just copy-pasting his code, try and figure out how to do the effect and learn some ActionScript on the way.

Here’s what I know as of now:

1. I must have an array of points, connect them using curveTo and fill it. For this I have to use this methods:

createMovieClip, lineStyle, beginFill, moveTo, curveTo, endFill

2. Then I must have a proximity detector for each point, more or less like:

dx = point._x - _xmouse;
dy = point._y - _ymouse;
distance = Math.sqrt(dxdx + dydy);

and if the mouse is too close to the point make it move away with a certain velocity (but only if the mouse is moving, if it is still, just make the blob wobble for a while, using an elasticity effect).

point._vx += point._ax;
point._x += point._vx;

where the acceleration must be a fraction of the distance we calculated before:

k = .2; // example
point._ax = distance * k;

but we must also have damping so we can have the elastic movement, so:

damp = .9; // example

point._vx += point._ax;
point._vx *= damp;
point._x += point._vx;

3. Finally when the mouse is clicked on a blob we must communicate with the others and make them all wobble, by using LocalConnection. I saw some tutorials on this and if I have everything else working I don’t think I’ll have much problem implementing this part, since it is pretty straight forward.

Now, what I’m having trouble with is getting this all into code, like, how do i make the array with all the points and access them?; how do I inpose the proximity detector into each point and make the curveTo’s change?

Any help on this would be much appreciated.

Note: There is a post on this board regarding a blob, which more or less functions the way this is supposed to function, but the code is just way to weird for me to understand :frowning: