PDA

View Full Version : [AS3] checkbox has no check mark - don't know why


tlassak
10-20-2009, 10:00 AM
Hi,

i am using FLEX libs for a RIA player. I have a weird effect that a checkbox has no check mark on it and i have no idea why. Here is my function

import mc.controls.CheckBox;
...

public function addItem (data : Object, checkFlag : Boolean = false) : void
{
var cont : HBox = new HBox();
var lable : DataLabel = new DataLabel();
lable.text = data.label;
lable.dataField = data.data;

var cbox : CheckBox = new CheckBox();
cbox.selected = checkFlag;
cbox.selected = true;
cbox.width = 30;
cbox.height = 30;

var item : Object = new Object();
item.cbox = cbox;
item.lable = lable;
this.itemList.push(item);

cont.addChild(cbox);
cont.addChild(lable);
this.addChild(cont);
}

Does a new CheckBox object inherit the UpIcon or any other icon from somewhere ?
Does anybody have an idea why the check mark is missing ?

Thanks .. Thomas

tlassak
10-20-2009, 10:03 AM
Should be "import mx.controls.CheckBox";

Could have other typos as well.

The code compiles and runs fine (checkbox colors change from ligh to dark grey and vice versa), just the checkbox doesn't have a check mark.