flash data integration:
Hi there,
after having spent 2 hours, I decided to get some help from you.
Here's what I'd like to do.
I have an XML file that I'd like to use to populate a DataGrid (in the future,
I'd like to do that also with a list).
I don't want to use the XML Connector and the Data Binding to do so in order
to keep my files as low as possible.
However I haven't been able to generate the array to populate the DataGrid
with a DataProvider. It works if I hard-code the array in AS but I'd like to
get the info from my XML File.
Could you please show me how to do this with ActionScript only?
That will save me big time!
Thanks a lot,
Vincent
My XML File:
<?xml version="1.0"?>
<pagesinfo>
<page id="0">
<pagename>homepage</pagename>
<pagecolor>2</pagecolor>
</page>
<page id="1">
<pagename>biography</pagename>
<pagecolor>0</pagecolor>
</page>
<page id="2">
<pagename>credits</pagename>
<pagecolor>1</pagecolor>
</page>
<page id="3">
<pagename>studio</pagename>
<pagecolor>2</pagecolor>
</page>
<page id="4">
<pagename>music</pagename>
<pagecolor>3</pagecolor>
</page>
<page id="5">
<pagename>contact</pagename>
<pagecolor>1</pagecolor>
</page>
</pagesinfo>
Snippet of my AS code:
// aPages is the array I use to populate the dataProvider
// (I want to get rid of this and use the XML File instead)
aPages = new Array({Page:"homepage", ColorStyle:"2", Preview:"off"},
{Page:"biography", ColorStyle:"0", Preview:"off"}, {Page:"credits",
ColorStyle:"1", Preview:"off"}, {Page:"services", ColorStyle:"3",
Preview:"off"}, {Page:"studio", ColorStyle:"1", Preview:"off"}, {Page:"music",
ColorStyle:"1", Preview:"off"}, {Page:"contact", ColorStyle:"1",
Preview:"off"});
// dgPagesListing is the datagrid I use on my scene.
dgPagesListing.dataProvider = aPages;