I recently added a room list to the flash Simple MMO World example. I am having problems removing the avatars of the previous room from the stage before joining the new room. I looked at the Avatar Chat example and saw that they used this:
Code: Select all
while (panel_chat.avArea.avContainer.numChildren > 0)
removeAvatar(getAvatar(0))
Code: Select all
while (mapArea.avContainer.numChildren > 0)
removeAvatar(getAvatar(0))
If I join a room after that I get the following error:TypeError: Error #1009: Cannot access a property or method of a null object reference.
I looked through the Avatar Chat example and saw that the removeAvatar and getAvatar functions are identical to the removeAvatar and getAvatar functions in the Simple MMO World example so I’m not sure why I’m getting this error. Any help would be greatly appreciated.TypeError: Error #2007: Parameter child must be non-null.
at flash.display::DisplayObjectContainer/removeChild()
Thanks,
Scott