PDA

View Full Version : [AS3] DataGrid w/ CheckBoxes


pip9ball
04-22-2012, 03:36 PM
Hello All,

I've been struggling for the past few days trying various different examples on the web to get a simple DataGrid component to include a checkBox component.

I finally came across the following example:
flashscript.biz%flblogger%datagrid_checkbox%Datagr id_Checkbox.zip

replace % with /.....I wasn't allowed to post a URL :-(

And this works! However, this example assumes that you already don't have a Flash project. In my case, I'm trying to integrate this code into a pretty big Flash project with 15-20 different classes.

I don't see any compile errors, however I also don't see the dataGrid component on the stage.

I have the following code executed when clicking on a panel:

var myBox:RendererExample = new RendererExample();

In the RendererExample class, I have the following:


..
..
..
public class RendererExample extends AbstractClass
{
private static var itemArray:Array = new Array ;
public function RendererExample ():void
{
/*
* We add a new DataGrid and set its properties.
*/
var myGrid:DataGrid = new DataGrid ;
myGrid.name = "Datagrid";
myGrid.move (35,80);
myGrid.setSize (350,125);
//this.addChildAt(myGrid, 1);
trace("I am executing some code");
addChild (myGrid);
..
..
..


I do see the output of the trace statement "I am executing some code", however the dataGrid cannot be seen.

I'm looking for some help on how I can add this dataGrid to an existing sprite on the stage that way I can make the entire sprite visible/invisible.

Thanks,

Pip