Hello Everyone-
I have been working on this for a few weeks now and cannot seem to figure it out. I have a flash movie that reads an xml file and parses it. I am able to parse the data and when I run a trace the xml is coming through as requested. I am having difficultly getting the parsed data into a datagrid. Below is the script I am using.
stop();
import fl.controls.DataGrid;
import fl.data.DataProvider;
var dp

ataProvider;
var myDataGrid

ataGrid = new DataGrid();
myDataGrid.addColumn("employeeid");
myDataGrid.addColumn("type");
myDataGrid.addColumn("style");
myDataGrid.addColumn("size");
myDataGrid.addColumn("length");
myDataGrid.addColumn("assigndate");
myDataGrid.setSize(350, 350);
myDataGrid.width=700;
myDataGrid.move(50, 110);
addChild(myDataGrid);
var myLoader:URLLoader=new URLLoader ;
var xmlData = new XML();
myLoader.addEventListener(Event.COMPLETE, LoadXML);
myLoader.load(new URLRequest("XML_WIN_Data.xml"));
function LoadXML(e:Event):void {
xmlData=new XML(e.target.data);
parse(xmlData);
}
function parse(Input:XML):void {
var dataroot:XMLList=Input.XML_WIN_Data.children();
var Attributes:XMLList=Input.XML_WIN_Data.attributes() ;
var List:XMLList = Input.XML_WIN_Data.(employeeid == ID);
trace(List);
dp = new DataProvider(List);
myDataGrid.dataProvider = dp;
}
BackButton.addEventListener(MouseEvent.CLICK,Backb utton);
function Backbutton (event:MouseEvent):void
{
gotoAndPlay("1");
}
The script works up through the "trace(List)" it is after that i am having trouble.
I have tried this:
dp = new DataProvider(List);
myDataGrid.dataProvider = dp;
and it does not work.
Any help would be great. I think I have everything I need it just need a little help posting the parsed data to the datagrid.
Thanks for any assistance you can provide. I can email the flash files if it would be easier to work with.
Thanks
Trent