Hi, I downloaded the random circles on this site. Its a good code, but it seems that the circles that move, just go everywhere. How would I make it so that when the circles hit a lone or something, stop and go in another direction.
You can find the code in the kirupalab. I think…
do you mean when they collide, they go the opposite direction. I think its called flash dectection.
im not sure how to do it though, mabye Kax will know. 
welcome to the forums, Comglomo, are you talking about these circles http://www.kirupa.com/lab/circles.htm ?
you’d have to use the hitTest function for collision between circles and that would probably be complicated if you had more than 2 circles…
If you are trying to do a realistic bounce on the borders, all you have to do is check the coordinates of the circles and switch them when they become greater or less than the boundaries…
let me clarify; if the circle is heading right, then you will tell the circle to inverse his _x speed in order to go the other way
here the variables xdirection and ydirection are the x and y speed of the circles
onClipEvent (enterFrame) {
if (this._x>=_root.rightwall._x || this._x<=_root.leftwall._x) {
_root.xdirection *= -1;
}
if (this._y>=_root.bottomwall._y || this._y<=_root.topwall._y) {
_root.ydirection *= -1;
}
}
Yes, thats what I was looking for, But should I make the right wall, left wall, bottom wall, and top wall movie clips?
Thanks for your help.
i did a little example:
<embed src=http://membres.lycos.fr/mlkdesign/kirupa/circles.swf height=300 width=300 type=application/x-shockwave-flash>
and here’s the fla:
http://membres.lycos.fr/mlkdesign/kirupa/circles.fla
mmhh, i dunno why the bottom bar doesnt show though :-\
reload the page and you’ll have a different speed…
Ok, you’ve got the idea of what I wanted, but if you watch for a little bit, all it does is bounce of the sides of the walls, I wanted it to have random movement, and if when one of the circles touches the wall, it will stop and turn around and go another way.
Your example never like stops anywhere, it just like keeps going… and stuff.
Thanks for your help.