# Assign variable to Checkbox component?

**URL:** <https://forum.kirupa.com/t/assign-variable-to-checkbox-component/302411>\
**Category:** flash\
**Created:** [December 29, 2009, 10:15pm UTC](https://forum.kirupa.com/t/assign-variable-to-checkbox-component/302411 "2009-12-29T22:15:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdavidwalker](https://avatars.discourse-cdn.com/v4/letter/m/4da419/32.png) [@mdavidwalker](https://forum.kirupa.com/u/mdavidwalker)\
**Post date:** [December 29, 2009, 10:15pm UTC](https://forum.kirupa.com/t/assign-variable-to-checkbox-component/302411/1 "2009-12-29T22:15:01Z")

</div>

I am trying to assign a few variables to checkboxes that I am adding dynamically to the stage. There are like 40 checkboxes added dynamically and I need to keep track of a few variables for each checkbox.

It will only let me assign a “name” to the checkbox. If I try something else like “Group” (see code), then I get a runtime error:

Error #1056: Cannot create property Grouping on fl.controls.CheckBox.

Does anyone know how to assign variables to checkboxes?  
Is it because its a component?

for (var i:Number = 0;i\<array.length;i++)  
{  
cb = new CheckBox();  
var mc\_cb = checkboxHolder.addChild(cb);  
mc\_cb.name = array\*.Id;  
mc\_cb.Group = array\*.Grouping;

}
