mardi 22 décembre 2015

AS3 MySQL-String to Array

I'm trying to get string from MySQL to be insert into Array and use the Array on my DataGrid. When I use it it fill three empty spaces in my DataGrid and doesn't display their names or any other values.

There is code where I think problem is:

function showResult3 (event:Event):void {
trace("ShowResult3");
var Numer:int;
var contactsTextFormat:TextFormat = new TextFormat();
contactsTextFormat.size = 15;   
var contactListArray:Array = event.target.data.givenContactList.split("(||)");

trace(contactListArray[0]);
trace(contactListArray[2]);

contacts_datagrid_1.columns = ["Nazwa"];
contacts_datagrid_1.setRendererStyle("textFormat",contactsTextFormat);
contacts_datagrid_1.dataProvider = new DataProvider(contactListArray);
//trace(event.target.data.givenContactList);

contacts_datagrid_1.addEventListener(Event.CHANGE, onSelectedGrid);
function onSelectedGrid (event:Event):void{
    trace(testTextBox_txt.text = "Selected " + event.target.selectedItem.Nazwa + " his number: " + event.target.selectedItem.Numer)

}}

Screenshot of the App for Visulation

Aucun commentaire:

Enregistrer un commentaire