I’m setting up some Radio Buttons. The desired effect is when you click a button, it calls a function which loops through an array of the button states, switching them off.
The stumbling block is changing the state of the buttons from on to off. I’m sure it’s an issue with the way I’m trying to get the instant name (eg radioBtn1) into the MovieClip Variable ‘currentRadioName’.
The error I receive is: TypeError: Error #1034: Type Coercion failed: cannot convert “radioBtn1” to flash.display.MovieClip.
So I’m trying to stick some object into a MovieClip object, which obviously doesn’t work.
Can someone point me in the right direction? Thanks
private function onRadioBtnHit(activeRadioBtn:int):void
{
var currentRadioName:MovieClip;
for (var i:int = 0; i < _tvRadioArray.length; i++)
{
if (!_tvRadioArray* == _tvRadioArray[activeRadioBtn])
{
_tvRadioArray* = false;
currentRadioName = MovieClip(“radioBtn”+(i+1));
currentRadioName.gotoAndStop(1);
}
else
{
_tvRadioArray* = true;
currentRadioName = MovieClip(“radioBtn”+(i+1));
currentRadioName.gotoAndStop(2);
}
}
}