I'm trying to make a checkbox act like a radio (yes i know its better to use radio) but for now i need to do this. The code im attaching is throwing an error and not sure why. I'm somewhat new to action script. Here is the code and the error i get...
ERROR
1118: Implicit coercion of a value with static type Object to a possibly unrelated type fl.controls:CheckBox.
It happened on this line
latest = e.currentTarget;
setupCheckBoxesSolv();
function setupCheckBoxesSolv()
{
for (var m:Number = 0; m < solvent.length; m++)
{
this["cb" + m] = new CheckBox();
this["cb" + m].label = solvent[m].dispName;
this["cb" + m].name = "Solv" + m;
this["cb" + m].addEventListener(MouseEvent.CLICK, deselectBox);
addChild(this["cb" + m]);
this["cb" + m].x = 280;
this["cb" + m].y = offset + m * 30;
}
}
var latest:CheckBox;
function deselectBox(e:Event):void
{
if(latest != null) latest.selected = false;
latest = e.currentTarget;
}

New Topic/Question
Reply



MultiQuote



|