# ParticleBehavior - how do i repel? (senocular?)

**URL:** <https://forum.kirupa.com/t/particlebehavior-how-do-i-repel-senocular/213979>\
**Category:** flash\
**Created:** [January 24, 2007, 7:05pm UTC](https://forum.kirupa.com/t/particlebehavior-how-do-i-repel-senocular/213979 "2007-01-24T19:05:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![xohol](https://avatars.discourse-cdn.com/v4/letter/x/59ef9b/32.png) [@xohol](https://forum.kirupa.com/u/xohol)\
**Post date:** [January 24, 2007, 7:05pm UTC](https://forum.kirupa.com/t/particlebehavior-how-do-i-repel-senocular/213979/1 "2007-01-24T19:05:58Z")

</div>

Hi,  
i am using senoculars ParticleBehavior class to get ‘leaves’ to repel from the mouse, and can’t seem to get it to work.

here is what i have:

[AS]  
import com.senocular.ParticleBehavior;  
//------------------------------------------------------------------------------------  
xp = 10;  
yp = 10;  
xpo = 10;  
ypo = 10;  
sp = 20;  
xGrid = (Math.ceil(Stage.width/20));  
yGrid = (Math.ceil(Stage.height/20));  
xgm = 1;  
points = xGrid\*yGrid;  
//------------------------------------------------------------------------------------  
for (i=1; i\<=points; i++) {  
//trace(i);  
l.attachMovie(“leaf”, “leaf”+i, l.getNextHighestDepth(), {\_x:xp, \_y:yp});  
l[“leaf”+i].\_rotation = random(360);  
l[“leaf”+i].onEnterFrame=lFrame  
xp += sp;  
xgm++;  
if (xgm\>xGrid) {  
yp += sp;  
xgm = 1;  
xp = xpo;  
}  
}  
function lFrame() {  
this.repel();  
[/AS]

does anyone have any experience with this?  
thanks!
