# Array help...pretty stuck!

**URL:** <https://forum.kirupa.com/t/array-help-pretty-stuck/222157>\
**Category:** Uncategorized\
**Created:** [April 11, 2007, 10:36am UTC](https://forum.kirupa.com/t/array-help-pretty-stuck/222157 "2007-04-11T10:36:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jenni\_fur](https://avatars.discourse-cdn.com/v4/letter/j/b2d939/32.png) [@jenni\_fur](https://forum.kirupa.com/u/jenni_fur)\
**Post date:** [April 11, 2007, 10:36am UTC](https://forum.kirupa.com/t/array-help-pretty-stuck/222157/1 "2007-04-11T10:36:13Z")

</div>

[LEFT]Morning everyone, would someone please have a look at the following code, for some reason when i apply the filter, it applies it to every clip on the stage. I just want it on the clips contained in the sweets array. Any help would be greatly appreciated??

import flash.filters.ColorMatrixFilter;

var matrix;  
var colorFilter;  
var n = 0;  
sweets = new Array();  
sweetsNum = 20;  
sweetsClips = 15;  
for (i = 0; i \< sweetsClips; i++)  
{ sweetsNum --;  
var mcSweets = sweets\_mc.duplicateMovieClip(“newclip\_sweets”+sweetsNum,sweetsNum);  
sweets.unshift(‘newclip\_sweets’ + sweetsNum);  
mcSweets.\_x = random (500);  
mcSweets.\_y = random (500);

```
trace (sweets);

```

}

btn.onPress = function()  
{  
for (i = 0; i \< sweets.length; i++){   
filters = [colorFilter];  
n= n + 0.01;  
colorFilter = new ColorMatrixFilter( matrix );  
matrix =  
[ 1, 0, 0, n, 0,  
0, 1, 0, 0, 0,  
0,0 , 1, 0, 0,  
0, 0, 0, 1, 0  
];  
}  
}  
btn\_take.onPress = function()  
{  
for (i=0; i\<sweets.length; i++){   
filters = [colorFilter];  
n= n - 0.01;  
colorFilter = new ColorMatrixFilter( matrix );  
matrix =  
[ 1, 0, 0, n, 0,  
0, 1, 0, 0, 0,  
0,0 , 1, 0, 0,  
0, 0, 0, 1, 0  
];  
}  
}[/LEFT]
