PDA

View Full Version : DataGrid - Load Data Dynamically


PlenaryCreation
10-20-2007, 05:54 PM
Hi everyone,

I have a tiny problem. I'd like to create a grid in Flash using the DataGrid component but what I want to do is to load all the information into the grid dynamically via .txt or .xml

I have no idea is this is possible or not and if it is I have no idea where to start. Could anyone point me into a direction ? The grid would contain 4-5 columns and more rows... On update, it should automatically add new rows into it if the administrator adds new objects.

PS: Is it possible to dynamically load images and text at the same time into it ? Example: the first column should be "thumb" and the other columns should contain an ID, Price, and so on... One more thing, after all this is done, is it possible to link rows to other .html pages or maybe make them act like button in flash ( maybe adding a gotoAndPlay(); action to a row or something ).

Thanks.

soupphysics
10-21-2007, 01:09 AM
Yeah, you can do that.

There are already functions in actionscript for loading xml files, and it's not too difficult.

Here's a video guide that shows it very easily. Pick the "Flash MP3 Player Part 1" tutorial. It is for making an mp3 player that loads the playlist from an xml file, and shows you the steps in loading the xml and parsing it very simple.

Besides that just search for guides on loading xml in actionscript.

PlenaryCreation
10-21-2007, 10:40 AM
Yeah, you can do that.

There are already functions in actionscript for loading xml files, and it's not too difficult.

Here's a video guide that shows it very easily. Pick the "Flash MP3 Player Part 1" tutorial. It is for making an mp3 player that loads the playlist from an xml file, and shows you the steps in loading the xml and parsing it very simple.

Besides that just search for guides on loading xml in actionscript.
Thanks for the reply but I know how to load data dynamically from txt or xml file into dynamic fields. What I don't know is how to load data into a DataGrid, columns , rows and so on.