Page 1 of 1
how to get a list of all the visible avatars in the map
Posted: 07 Jul 2009, 16:49
by josuedavid
Hello to all, we need to change some properties of all the visible avatars in the map, the idea is to get all the visible avatars in the map, you have some idea of how to do that??
thank you in advance..
Posted: 07 Jul 2009, 17:03
by sstark
hrm, I can only think of one approach at the moment, and it'd be an experiment.
As I understand it, only the tiles visible (plus a small buffer) are ever displayed... thus, it is possible that listening to the ENTER_TILE and EXIT_TILE events may provide you with enough information to determine if the specific avatar is visible, and track that information in a custom object.
Could be a simpler solution I am missing, and this could easily not work... this is just a guess atm.
Posted: 08 Jul 2009, 06:43
by Bax
There isn't an easy way to do this, also it really depends on how and when you need to do this. The sstark approach is valid if you need to monitor avatars continuously. Otherwise you may get a reference to each avatar by means of the (undocumented, sorry) OpenSpace.getAvatarMovieClipById(userId) method. In both cases you then need to evaluate if the avatar is visible or not. You may check if its parent tile is in the displaylist for example, or something like that.