# Need Help To Tame Kirupa's Particles - XY max

**URL:** https://forum.kirupa.com/t/need-help-to-tame-kirupas-particles-xy-max/152650
**Category:** flash
**Created:** [June 26, 2005, 3:02pm UTC](https://forum.kirupa.com/t/need-help-to-tame-kirupas-particles-xy-max/152650 "2005-06-26T15:02:26Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![BusyBody](https://avatars.discourse-cdn.com/v4/letter/b/58f4c7/32.png) [@BusyBody](https://forum.kirupa.com/u/BusyBody)
#### Post date: [June 26, 2005, 3:02pm UTC](https://forum.kirupa.com/t/need-help-to-tame-kirupas-particles-xy-max/152650/1 "2005-06-26T15:02:26Z")

</div>

A “L” Driver question…  
followed the Tutorial on Particles but am unable to tame the particles  
to move within a designated X & Y space…  
here is script in frame 1&2

xMin = 10;  
xMax = 450;  
yMin = 10;  
yMax = 300;  
minSize = 5;  
maxSize = 40;  
easeFactor = 8;

randomX = Math.random () \* ( xMax - xMin ) + xMin;  
randomY = Math.random () \* ( yMax - yMin ) + yMin;  
randomSize = Math.random () \* ( maxSize - minSize ) + minSize;

Frame 3 is as follows

distance = Math.sqrt(Math.pow(this.\_x-randomX, 2)+Math.pow(this.\_y-randomY, 2));

if (Math.abs(this.\_width-maxSize)\>1) {  
this.\_width += (randomSize-this.\_width)/2;  
this.\_height += (randomSize-this.\_height)/2;  
}

if (distance\>1) {  
this.\_x += (randomX-this.\_x)/easeFactor;  
this.\_y += (randomY-this.\_y)/easeFactor;  
gotoAndPlay(2);  
} else {  
gotoAndPlay(1);  
}

Is there anyway to change the colors of the particles to random while its moving?  
Would like to thank in advance the Flash Gurus for taking time to respond.  
Thanxs…

:nerd:
