as3 loops and event listeners

Posted by Ross on Stack Overflow See other posts from Stack Overflow or by Ross
Published on 2010-04-13T19:19:54Z Indexed on 2010/04/13 19:23 UTC
Read the original article Hit count: 470

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);    

}

© Stack Overflow or respective owner

Related posts about as3

Related posts about loops