Hi need to know how to look at specific rows in a datagrid. my data grid has one column but multiple rows of info loaded from an xml file, i need to use indexOf on specific rows how would i direct that command to specific rows in the datagrid?
You can access each row in the DataGrid by using: datgrid_instance.getItemAt(rowNumber).columnName rowNumber : zero-based numbering columnName : name of the column you want the data from Not sure what the return type is (most likely an Object) so you should probably be safe and typecast the returned value into a String. var myRow:String = String(datagrid.getItemAt(2).label); Tim
so i tried this, it should return the index of team and the total length it returns -1 and 9, the total length of that row (all rows actually) are well over 9 and Team is not at -1 this.myReceiveXMLConnector.trigger(); var myRow:String = String(myDataGrid.getItemAt(1).description); myField_txt.text = myRow.indexOf("Team"); totalLength_txt.text = myRow.length;
Are you waiting to make sure that the XMLConnector has recieved the data? Can you send me a link to your program? I can help more if I can see the code you are trying to use. If not, can you send a sample of the XML file that you are reading? I can then try to mock up to same thing and give you more explicit help. Tim
Are you waiting to make sure that the XMLConnector has recieved the data? Can you send me a link to your program? I can help more if I can see the code you are trying to use. If not, can you send a sample of the XML file that you are reading? I can then try to mock up to same thing and give you more explicit help. Tim
I will take a look at the files but in the mean time, make sure that in your publish settings that you have set the "Local playback security" pulldown menu under the Flash tab to "Access network only". Tim
Sorry I didn't notice this before but I just saw that you are loading the XML from a different domain than where you Flash movie is. This is why it will work from your desktop in test mode and not from your server. You are having a domain security issue. You can only read files into Flash that on in the same domain or if you have the crossdomain.xml setup on the server that contains the XML file you want. Do a search in the Help Docs for: Allowing cross-domain data loading To me, it is kind of confusing, but the basic this is that if you want cross domain data then you have to use the crossdomain.xml file and that means you have to have access to the server (not yours but the other one.) Tim
Don't see what you're looking for? Try a search.
|