# Random Colors

**URL:** https://forum.kirupa.com/t/random-colors/288297
**Category:** Uncategorized
**Created:** [May 13, 2009, 8:25pm UTC](https://forum.kirupa.com/t/random-colors/288297 "2009-05-13T20:25:40Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![SopaSeco](https://avatars.discourse-cdn.com/v4/letter/s/53a042/32.png) [@SopaSeco](https://forum.kirupa.com/u/SopaSeco)
#### Post date: [May 13, 2009, 8:25pm UTC](https://forum.kirupa.com/t/random-colors/288297/1 "2009-05-13T20:25:40Z")

</div>

Hi, I’m trying to transform the color of a movieclip, the movie clip is duplicate in more and those move from the center of the screen to the sides. I want some colors specifics those i drop inside a var but i don’t know how to make the random take those colors.

I’m used this code

```auto

[SIZE=2]var colorInfo:ColorTransform = rectangle.transform.colorTransform;
var colors:Array=new Array(0x790029,0xFF3951,0x600027,0xA3D512,0x00BEF5,0xFFF400);
colorInfo.color = 0xffffff * Math.random();
rectangle.transform.colorTransform = colorInfo;
addChildAt(rectangle,0);
rectangle.blendMode="multiply";[/SIZE]

```
