Correct answer by
Not applicable
26-02-2009
17:02 PST
- Mark as New
- Follow
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report
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,onEventNotific
ation);
cSession.login();
//throws error message
}
private function
onEventNotification(event:SessionEvent):void
{
cSession.userManager.setUserDisplayName(cSession.userManager.myUserID,
"basu");
}
]]>
</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>
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,onEventNotific
ation);
cSession.login();
//throws error message
}
private function
onEventNotification(event:SessionEvent):void
{
cSession.userManager.setUserDisplayName(cSession.userManager.myUserID,
"basu");
}
]]>
</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>
Views
Replies
0 Likes
Total Likes