Hello everyone,
I have a little problem with the DataGrid component. It’s a very simple DataGrid with 1 column to get some stuff out of a database and list it.
The issue is that I use the same flash file for different languages, which means that the header of that columns has to be the correct word in every language. (different languages are loaded through different language txt files).
Here is the simplified piece of AS code that I have:
dg.columnNames = ["col"];
var arr = new Array();
for (var i = 0; i<data_array.length; i++) {
arr.push({col:i});
}
dg.dataProvider = arr;
This works great, but if however I want to change the name of the column in the variable that I´m using for the column name like:
dg.columnNames = [_root.colName];
var arr = new Array();
for (var i = 0; i<data_array.length; i++) {
arr.push({_root.colName:i});
}
dg.dataProvider = arr;
It’s giving me the compiler error: ‘:’ expected
Does anyone how to fix this?