as3 loops and event listeners
- by Ross
I have an array that returns multidimensional data from an mysql database, when this is collected the createNews function creates the user interface. The problem I am having is the loop is iterating quicker than the ui is being created, is there a way to use event listeners with loops so it only continues after my function has completed its work. Any solutions or ideas are much appreciated;
Thanks,
R.
  var t:Array =
  responds.serverInfo.initialData;
   for (var i:uint = 0; i < t.length;
  i++) {
    var date = t[i][1];
    var newstitle = t[i][2];
    var story= t[i][3];
    var image = t[i][4];
   createNews(date, newstitle, story, image);    
  
  }