PDA

View Full Version : CheckBox doesn't show up


logbert
01-03-2007, 06:42 PM
I am working on an application written completely from ActionScript (little to no work actually done with the Flash IDE).

Anyway, I have a Window component with a few button components, labels, etc. These components all seem to be working, but for whatever reason, the code I have for creating and displaying a CheckBox is not working.

Here's a snippet of the code that builds the checkbox:


import mx.controls.CheckBox;

function makeCheckBox():CheckBox
{
var chb:CheckBox = CheckBox (this.container.createClassObject(CheckBox, "cb", 5));
dtrace(chb);
return (chb);
}


The trace shows null. Can anyone see anything blatantly wrong with this code? I have several other functions that make components the same exact way (example: ComboBox using that same code only changing CheckBox to ComboBox and a different name/level). The code for every other component works perfectly fine.

Here's the code where the CheckBox is added to the window:


function build()
{
var table:Table = new Table (this.win, this.child_depth++);
var showCheckBox = table.makeCheckBox();
..
table.addChild (showCheckBox, [2, 0, 1, 1, ""]);
..
}


All the other components I built are loaded into this table. They all show up. I also have an event handler for this CheckBox but the CB does not show up regardless of whether I comment that code out or not.

Any ideas?