Skip to main content
Participant
June 3, 2010
Question

Why application.clients array gets disordered ?

  • June 3, 2010
  • 1 reply
  • 304 views

I have one application, is like a room of students. So whenever one client (flex client) is connected is like a new student in the room. I have been researching and I found that every new client is stored in application.clients

If I have 3 students connected, lets say student1, student2, student3, and student4 if I made a trace :

for (var i = 0; i<application.clients.length; i++){

     trace("student "+i+": "+application.clients.name);

}

It shows me in the log:

student1

student2

student3

student4

Now, if student2 left the room, the trace is:

student1

student4

student3

I need to have the the application.clients in order, I mean, after student2 has left the room to have:

student1

student3

student4

Please, what I can do to resolve this problem ?

Thanks in advance.

    This topic has been closed for replies.

    1 reply

    Petro_O__Bochan
    Inspiring
    June 3, 2010

    Apart from the fact that u use the Flex client which most likely already deploys some built in dataProvider sorting mechanisms u need to rethink your app since this kind of 'feature' is usually solved with either associative arrays or with SharedObject(s).

    calmchessplayer
    Inspiring
    June 3, 2010

    I was explianing in another post.....why are you cross posting?  i gave you some tips on what you need to do what don't you understand......and how many students do you think you are going to sort per room?.......you have to build a custom sorting routine I have done this myself.