dcsimg
A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: DataGrid issue

  1. #1

    DataGrid issue

    Hello,

    I noticed that DataGrids only seem to get populated with information when embedded in html, but not when you simply open the swf... does anyone know why, and if so, is there a way I can get it to work in the standalone player?

    thank you very much
    Adam

  2. #2
    Senior Member
    Join Date
    Apr 2001
    Posts
    528
    Where is your datasource coming from? Inside the Flash movie? externally?

  3. #3
    Originally posted by Chieffan
    Where is your datasource coming from? Inside the Flash movie? externally?
    right inside, it's an array:

    scanList = new Array(
    {name:"Bob Dole", date:"09/23/2004", status:"Queued"},
    {name:"Ted Danson", date:"09/22/2004", status:"Queued"},
    {name:"Alf", date:"09/21/2004", status:"Queued"},
    {name:"David Hasselhoff", date:"09/23/2004", status:"Queued"},
    {name:"MC Hammer", date:"09/20/2004", status:"Scanned"},
    {name:"John Doe", date:"09/19/2004", status:"Scanned"},
    {name:"Jane Doe", date:"09/17/2004", status:"Scanned"},
    {name:"Buford T. Justice", date:"09/16/2004", status:"Scanned"},
    {name:"Michelangelo Buonerati", date:"09/15/2004", status:"Rx Filled"},
    {name:"Bib Fortuna", date:"09/14/2004", status:"Rx Filled"},
    {name:"Al Gore", date:"09/13/2004", status:"Rx Filled"},
    {name:"John Kerry", date:"09/13/2004", status:"Rx Filled"},
    {name:"Adam Fraser", date:"09/12/2004", status:"Rx Filled"},
    {name:"Turd Fergeson", date:"09/11/2004", status:"At Lab"},
    {name:"Millie Vanilly", date:"09/8/2004", status:"At Lab"},
    {name:"Billie Holiday", date:"09/5/2004", status:"At Lab"},
    {name:"Cheese Nips", date:"09/3/2004", status:"At Lab"},
    {name:"Miles Davis", date:"09/2/2004", status:"At Lab"},
    {name:"Don King", date:"09/2/2004", status:"At Lab"},
    {name:"Angelina Jolie", date:"09/2/2004", status:"At Lab"},
    {name:"Mich Jagger", date:"09/2/2004", status:"At Lab"},
    {name:"Pinnochio", date:"09/2/2004", status:"At Lab"},
    {name:"Homer Simpson", date:"09/2/2004", status:"At Lab"},
    {name:"Peter Griffin", date:"09/2/2004", status:"At Lab"}
    );

    //Set data provider for DataGrid
    scans.dataProvider = scanList;




    ...that code is all on the first and only frame.

  4. #4
    Senior Member
    Join Date
    Apr 2001
    Posts
    528
    I got the exe file to work.

    I had the folowing where myDP is equal to your array.

    myDataGrid.dataProvider = myDP;
    //the above code defines the variable DP to the grid
    myDataGrid.resizableColumns = true;
    myDataGrid.spaceColumnsEqually();

    I tried posting the zip file but it was too big.

  5. #5
    Originally posted by Chieffan
    I got the exe file to work.

    I had the folowing where myDP is equal to your array.

    myDataGrid.dataProvider = myDP;
    //the above code defines the variable DP to the grid
    myDataGrid.resizableColumns = true;
    myDataGrid.spaceColumnsEqually();

    I tried posting the zip file but it was too big.
    I appreciate the effort but it still doesn't work.

    A few things:
    1) it's not an exe I'm trying to run, it's the swf in the player
    2) the swf actually works normally when I preview it in flash
    3) here is the full code on the first frame:

    scanList = new Array(
    {name:"Bob Dole", date:"09/23/2004", status:"Queued"},
    {name:"Ted Danson", date:"09/22/2004", status:"Queued"},
    {name:"Alf", date:"09/21/2004", status:"Queued"},
    {name:"David Hasselhoff", date:"09/23/2004", status:"Queued"},
    {name:"MC Hammer", date:"09/20/2004", status:"Scanned"},
    {name:"John Doe", date:"09/19/2004", status:"Scanned"},
    {name:"Jane Doe", date:"09/17/2004", status:"Scanned"},
    {name:"Buford T. Justice", date:"09/16/2004", status:"Scanned"},
    {name:"Michelangelo Buonerati", date:"09/15/2004", status:"Rx Filled"},
    {name:"Bib Fortuna", date:"09/14/2004", status:"Rx Filled"},
    {name:"Al Gore", date:"09/13/2004", status:"Rx Filled"},
    {name:"John Kerry", date:"09/13/2004", status:"Rx Filled"},
    {name:"Adam Fraser", date:"09/12/2004", status:"Rx Filled"},
    {name:"Turd Fergeson", date:"09/11/2004", status:"At Lab"},
    {name:"Millie Vanilly", date:"09/8/2004", status:"At Lab"},
    {name:"Billie Holiday", date:"09/5/2004", status:"At Lab"},
    {name:"Cheese Nips", date:"09/3/2004", status:"At Lab"},
    {name:"Miles Davis", date:"09/2/2004", status:"At Lab"},
    {name:"Don King", date:"09/2/2004", status:"At Lab"},
    {name:"Angelina Jolie", date:"09/2/2004", status:"At Lab"},
    {name:"Mich Jagger", date:"09/2/2004", status:"At Lab"},
    {name:"Pinnochio", date:"09/2/2004", status:"At Lab"},
    {name:"Homer Simpson", date:"09/2/2004", status:"At Lab"},
    {name:"Peter Griffin", date:"09/2/2004", status:"At Lab"}
    );

    //Set data provider for DataGrid
    scans.dataProvider = scanList;

    // Kill Borders
    scans.borderColor = 0xFFFFFF;
    scans.buttonColor = 0xFFFFFF;
    scans.borderCapColor = 0xFFFFFF;
    scans.highlightColor = 0xFFFFFF;
    scans.shadowCapColor = 0xFFFFFF;
    scans.shadowColor = 0xFFFFFF;

    //scans.showHeaders = false;
    scans.resizableColumns = true;
    scans.spaceColumnsEqually();
    scans.fontSize = 18;
    scans.fontFamily = "times new roman";
    scans.vGridLines = false;
    scans.hGridLines = false;
    scans.rollOverColor = 0xE5E2FF;
    scans.selectionColor = 0xCFCAFF;
    scans.textRollOverColor = 0x000000;
    scans.textSelectedColor = 0x000000;
    scans.setStyle("alternatingRowColors", [0xEEEEEE, 0xFFFFFF]);


    ...is there anything there that would stop the swf from loading in the data as normal? ... this is very strange.

    ...also I was wondering if there was a way to scale the scrollbar size up a bit so they're bigger.
    Last edited by Agent o04; 01-20-2005 at 04:30 PM.

  6. #6
    Senior Member
    Join Date
    Apr 2001
    Posts
    528
    See if this works and if it does I will add your code and send the fla.
    Attached Files Attached Files

  7. #7
    Originally posted by Chieffan
    See if this works and if it does I will add your code and send the fla.

    : \

    nope, just shows a little rectangle where you put the grid, no data, border, scrollbars, column headers or anything.

    *shrug*

    thanks though... any idea why it's doing/not doing this?


    PS: we both registered at flash kit the same month in 2001, wierd.
    Last edited by Agent o04; 01-20-2005 at 05:37 PM.

  8. #8
    Senior Member
    Join Date
    Apr 2001
    Posts
    528
    Strange. I tried attaching the FLA but it is too big (486kb). Do you have another way I can send to you.

  9. #9
    Originally posted by Chieffan
    Strange. I tried attaching the FLA but it is too big (486kb). Do you have another way I can send to you.
    if you could email it to me at agentfraser@hotmail.com that'd be great!

    thanks again ^.^

  10. #10
    Senior Member
    Join Date
    Apr 2001
    Posts
    528
    Just sent it. Hopefully you get it through our firewall. If you don't post it and I will try from my home.

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