Hi,
I ran a small example for your case. You need to wait for the
synschronization change event after you relogin since you need to
wait for all Managers (including UserManager to be synchronized)
before you set the name again.
Here is a small example :
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"layout="absolute" xmlns:rtc="AfcsNameSpace" >
<mx:Script>
<![CDATA[
import com.adobe.rtc.events.SessionEvent;
import com.adobe.rtc.sharedManagers.UserManager;
private var _userManager:UserManager ;
private function onLogoutLogin():void
{
cSession.logout();
cSession.roomURL = "Your Room Url";
cSession.authenticator = auth;
cSession.addEventListener(SessionEvent.SYNCHRONIZATION_CHANGE,onEventNotification);
cSession.login();
//throws error message
}
private function
onEventNotification(event:SessionEvent):void
{
cSession.userManager.setUserDisplayName(cSession.userManager.myUserID,
"Hironmay");
}
]]>
</mx:Script>
<rtc:ConnectSessionContainer id="cSession" roomURL="Room
Url">
<rtc:authenticator>
<rtc:AdobeHSAuthenticator userName="User Name"
password="Password" id="auth" />
</rtc:authenticator>
<rtc:Roster />
<mx:Button label="Logout/Login" click="onLogoutLogin()"
/>
</rtc:ConnectSessionContainer>
</mx:Application>