# Use wildcards in as3?

**URL:** <https://forum.kirupa.com/t/use-wildcards-in-as3/306702>\
**Category:** Uncategorized\
**Created:** [March 20, 2010, 12:43pm UTC](https://forum.kirupa.com/t/use-wildcards-in-as3/306702 "2010-03-20T12:43:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikaelf](https://avatars.discourse-cdn.com/v4/letter/m/8edcca/32.png) [@mikaelf](https://forum.kirupa.com/u/mikaelf)\
**Post date:** [March 20, 2010, 12:43pm UTC](https://forum.kirupa.com/t/use-wildcards-in-as3/306702/1 "2010-03-20T12:43:07Z")

</div>

Hi all,

I have 30 buttons called thumb01 to thumb30.

I have created this functions so when hoover over and hoover out of the one of the buttons it changes colour.  
I would like to use this for all my 30 buttons, but I dont want ot write the same code 30 times. Is there a way to for example to use wildcards so I can write thumbxx and adress all the buttons.

Much appriciated thanx.

var col:Color = new Color();  
col.setTint(0xFFFFFF, 0.5);

set1\_mc.thumb01\_btn.addEventListener(MouseEvent.MOUSE\_OVER,hooverOver);  
function hooverOver(event:MouseEvent):void  
{  
set1\_mc.thumb01\_btn.transform.colorTransform = col;  
}

set1\_mc.thumb01\_btn.addEventListener(MouseEvent.MOUSE\_OUT,hooverOut);  
function hooverOut(event:MouseEvent):void  
{  
set1\_mc.thumb01\_btn.transform.colorTransform= new ColorTransform()  
}
