A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: A Component in a DataGrid

  1. #1
    Junior Member
    Join Date
    Aug 2010
    Posts
    4

    Arrow A Component in a DataGrid

    hey guys, i'm using flash CS4 and i'm wondering how to place a component into a DataGrid.

    I was able to grab this script from the live docs on how to place an image to a DataGrid but I want to replace it with a button. Thanks.


    Code:
    import fl.controls.DataGrid;
    import fl.controls.dataGridClasses.DataGridColumn;
    import fl.data.DataProvider;
    
    var dp:DataProvider = new DataProvider();
    dp.addItem({data:"http://www.helpexamples.com/flash/images/image1.jpg", title:"image1.jpg"});
    dp.addItem({data:"http://www.helpexamples.com/flash/images/image2.jpg", title:"image2.jpg"});
    dp.addItem({data:"http://www.helpexamples.com/flash/images/image3.jpg", title:"image3.jpg"});
    dp.addItem({data:"Bear", title:"Bear.jpg"});
    dp.addItem({data:"Lion", title:"Lion.jpg"});
    
    var dataCol:DataGridColumn = new DataGridColumn("data");
    dataCol.cellRenderer = LoaderCellRenderer;
    
    var titleCol:DataGridColumn = new DataGridColumn("title");
    
    var myDataGrid:DataGrid = new DataGrid();
    myDataGrid.addColumn(dataCol);
    myDataGrid.addColumn(titleCol);
    myDataGrid.dataProvider = dp;
    myDataGrid.rowHeight = 64;
    myDataGrid.width = 200;
    myDataGrid.rowCount = dp.length - 1;
    myDataGrid.move(10, 10);
    addChild(myDataGrid);

  2. #2
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    - The right of the People to create Flash movies shall not be infringed. -

  3. #3
    Junior Member
    Join Date
    Aug 2010
    Posts
    4
    thanks a million!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center