Hi,
I am adding a small code for showing collection Node creation
and setUserRole. The important thing to note is you need to call
collectionNode.subscribe() after creating before you can call
collectionNode.setUserRole else you will get that RTE.
Here is the code below for reference.
Thanks
Hironmay Basu
<?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.sharedModel.CollectionNode;
import com.adobe.rtc.messaging.UserRoles;
private var collectionNode:CollectionNode ;
private function onCreationComplete():void
{
collectionNode = new CollectionNode();
collectionNode.sharedID = "sharedModel4" ;
collectionNode.connectSession = cSession ;
collectionNode.subscribe();
collectionNode.setUserRole(cSession.userManager.myUserID,UserRoles.PUBLISHER);
}
]]>
</mx:Script>
<rtc:AdobeHSAuthenticator id="auth" userName="Your
UserName" password="Your Password"/>
<rtc:ConnectSessionContainer id="cSession"
authenticator="{auth}" roomURL="Your Room Url"
creationComplete="onCreationComplete()" >
</rtc:ConnectSessionContainer>
</mx:Application>