# Passing variables through multiple movieclips

**URL:** <https://forum.kirupa.com/t/passing-variables-through-multiple-movieclips/149233>\
**Category:** flash\
**Created:** [May 27, 2005, 1:37am UTC](https://forum.kirupa.com/t/passing-variables-through-multiple-movieclips/149233 "2005-05-27T01:37:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![PaintedSwan](https://avatars.discourse-cdn.com/v4/letter/p/90db22/32.png) [@PaintedSwan](https://forum.kirupa.com/u/PaintedSwan)\
**Post date:** [May 27, 2005, 1:37am UTC](https://forum.kirupa.com/t/passing-variables-through-multiple-movieclips/149233/1 "2005-05-27T01:37:41Z")

</div>

Basically I just wondered if there was any way to condense this so I don’t have to keep repeating the code over and over for all of the movieclips:

[AS]onClipEvent (enterFrame) {  
var colorChanger:Color = new Color(this.\_parent.leaf8);  
var origTransform:Object = colorChanger.getTransform();  
var newtintTransform:Object = {rb:10, bb:0, gb:-15};  
var colorChanger2:Color = new Color(this.\_parent.leaf9);  
var origTransform2:Object = colorChanger2.getTransform();  
var newtintTransform2:Object = {rb:10, bb:0, gb:-15};  
}[/AS]

And so on…there are going to be about 9 clips I want this color changer to apply to, but I’m not sure how to make this code cleaner, since I’m a total newb! Any help would be appreciated. 😃
