Quantunet.com

My Account

Joins Us
Flash 8 Actionscript 2.0 QuickSkills
Randomly Attaching Multiple Instances III (color)  


Download .fla

How to create this effect.


Actionscript

var numBalls:Number = 20;

onMouseDown = function (){
for(i=0;i<numBalls;i++){
var ball = this.attachMovie("ball","ball" +i,i);
ball._x = _xmouse + (Math.pow(-1, 3*Math.round(Math.random())))*50*Math.random();
ball._y = _ymouse + (Math.pow(-1, 3*Math.round(Math.random())))*50*Math.random();
ball._xscale = ball._yscale = 100*Math.random();

myColoredObject = new Color (ball);
myColoredObject.setRGB(Math.round(Math.
random()*0x00FFFF));
}
}



b.randy = Math.round(Math.random()*Stage.height);

b.onEnterFrame =

© 2008 Quantunet LLC All Rights Reserved | Intellectual Property | Terms of Use | Privacy
Home | About Quantunet | FAQ's | Contact Us