# Using variables with transform.colorTransform

**URL:** <https://forum.kirupa.com/t/using-variables-with-transform-colortransform/281267>\
**Category:** flash\
**Created:** [February 6, 2009, 6:07pm UTC](https://forum.kirupa.com/t/using-variables-with-transform-colortransform/281267 "2009-02-06T18:07:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pixel\_chick](https://avatars.discourse-cdn.com/v4/letter/p/eada6e/32.png) [@pixel\_chick](https://forum.kirupa.com/u/pixel_chick)\
**Post date:** [February 6, 2009, 6:07pm UTC](https://forum.kirupa.com/t/using-variables-with-transform-colortransform/281267/1 "2009-02-06T18:07:57Z")

</div>

I have declared a handful of new colors like this:  
var colTransNameNumber:ColorTransform = new ColorTransform();  
colTransNameNumber.color = 0x77060A;

The name and number are coming from variables in the query string but when I try to call the colors by doing “colTrans” + name + num, I get the Type Coercion failed: cannot convert “colTransDEM40” to flash.geom.ColorTransform. error. Does anyone know how to create this in the correct format?

thanks.
