# \[FMX2004\] Need help with blob-like effect

**URL:** <https://forum.kirupa.com/t/fmx2004-need-help-with-blob-like-effect/39258>\
**Category:** flash\
**Created:** [January 5, 2004, 11:46am UTC](https://forum.kirupa.com/t/fmx2004-need-help-with-blob-like-effect/39258 "2004-01-05T11:46:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![darkwood](https://avatars.discourse-cdn.com/v4/letter/d/258eb7/32.png) [@darkwood](https://forum.kirupa.com/u/darkwood)\
**Post date:** [January 5, 2004, 11:46am UTC](https://forum.kirupa.com/t/fmx2004-need-help-with-blob-like-effect/39258/1 "2004-01-05T11:46:30Z")

</div>

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](http://www.neave.com/rant/). 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(dx_dx + dy_dy);

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](http://www.kirupaforum.com/forums/showthread.php?threadid=7273&highlight=blob) 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 ☹
