how to refresh datagrid automatically


i want built multiplayer game, put datagrid show available room, user not create room can join room clicking @ datagrid.
im using sql database , php parse variable show data want on flash..

 

this as2 @ frame"room" show datagrid. work fine when go frame @ first time.

loadallroom_lv.id_user = id_login;

loadallroom_lv.sendandload(filepath+ "multi_gridallroom_data.php",loadallroom_lv,"post")

loadallroom_lv.onload=function()

{

          var datanoroom:array = loadallroom_lv.no_score.split(",",loadallroom_lv.baris);

          var dataroomname:array = loadallroom_lv.room_name.split(",",loadallroom_lv.baris);

          var dataroommaster:array = loadallroom_lv.room_master.split(",",loadallroom_lv.baris);

          var dataroomstatus:array = loadallroom_lv.room_status.split(",",loadallroom_lv.baris);

          for (var i=0; i<loadallroom_lv.baris; i++)

          {

                      arrayroom.additem({no:datanoroom[i], room_name:dataroomname[i], room_master:dataroommaster[i], status:dataroomstatus[i]});

          }

     grid_allroom.dataprovider = arrayroom;

     grid_allroom.setsize(540, 300);

     grid_allroom.rowheight = 30;

     grid_allroom.getcolumnat(0).width = 40;

     grid_allroom.getcolumnat(1).width = 200;

     grid_allroom.getcolumnat(2).width = 200;

     grid_allroom.getcolumnat(3).width = 100;

}

 

for example, there 2 user on line @ same server..

they access game @ same time..
"alan" create room, , "brian" directly view room list..
firstly, brian not seeing alan's room (since not yet created).
but then, when alan finish creating room, brian can view alan's room @ datagrid.

 

my problem here..

brian didn't see room created alan @ datagrid because datagrid show data alan's room not yet created..

 

my conclusion..
i have refresh datagrid automatically!

 

my question..

how refresh datagrid automatically or periodicly?

what should do? use timer? or 1 there have solution, don't have put refresh button "that refresh stuff".


share me link, source code, , knowledge.. thx..

when php updates data should send update users datagrids update.



More discussions in ActionScript 1 and 2


adobe

Comments

Popular posts from this blog

How to set the order of FAQs instead of alphabetical

Thread: Get UK Keyboard working

how do I change the e-mail address for my merchant account