# \[MX\] Dynamic setGroupName

**URL:** <https://forum.kirupa.com/t/mx-dynamic-setgroupname/91596>\
**Category:** Uncategorized\
**Created:** [October 6, 2003, 3:35pm UTC](https://forum.kirupa.com/t/mx-dynamic-setgroupname/91596 "2003-10-06T15:35:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![WhutEvr](https://avatars.discourse-cdn.com/v4/letter/w/ee59a6/32.png) [@WhutEvr](https://forum.kirupa.com/u/WhutEvr)\
**Post date:** [October 6, 2003, 3:35pm UTC](https://forum.kirupa.com/t/mx-dynamic-setgroupname/91596/1 "2003-10-06T15:35:17Z")

</div>

I’m trying to dynamically group FRadioButtonSymbols.

I have the values of the buttons being dynamically generated, but am stuck getting the buttons to group in sets of 2.

my data string is:  
This part of the string would be Group1:  
&Name0=Team1&DataRow0=MIN&Name1=Team2&DataRow1=GB  
This part of the string would be Group2:  
&Name2=Team1&DataRow2=TB&Name3=Team2&DataRow3=PHI

If I try to assign a group name in the data string, it defaults to the last group name.

The code I’m trying to use is:  
function AddItems() {  
numItems = myData.NumItems;

```
defaultX = 40;
defaultY = 40;

for (i=0; i&lt;numItems; i++) {
		
		RadioID = "Radio"+i;
		attachMovie("FRadioButtonSymbol", RadioID, i);

		RadioID = eval(RadioID);
		
		RadioID.setSize(150); 
		
		RadioID._x = defaultX;			
		RadioID._y = defaultY + (i * 20);
					
		var radioGroup = eval("myData.Group");
		
		var Name = eval("myData.Name"+i);
		var DataRow = eval("myData.DataRow"+i);
		
		RadioID.setGroupName(radioGroup);
		RadioID.setData(DataRow); 
		RadioID.setLabel(Name);
		
}
radioGroup.setChangeHandler("SelectItem");

```

}

function SelectItem(){

\_root.Name = radioGroup.getValue();

}
