I can't modelize the loginDialog.


at present,i'm developing live conference system.

 

but when want modulize live room,

 

it can't work normally,

 

at first time entered,

 

everything can work,

 

but fileshare breaked down @ second time.

 

i'm confused can't work.

 

in addition,the fileshare can't  upload , download files in guest status.

 

may me?

 

thank you! : )

 

the following flex code i  edited adobe example.

 

application test_flex.mxml

 

<?xml version="1.0" encoding="utf-8"?>
<mx:application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:script >
  <![cdata[
   private var ss:logindialog;
   private function xd():void{
    ss=null;
    ss=new logindialog();
    this.addchild(ss);
   }
  ]]>
</mx:script>
<mx:button x="134.5" y="283" label="button" click="xd();"/>

</mx:application>

 

compoment logindialog.mxml

<?xml version="1.0" encoding="utf-8"?>
<mx:canvas
xmlns:mx="http://www.adobe.com/2006/mxml"
  creationcomplete="init();"
xmlns:rtc="afcsnamespace"  width="100%" height="100%">

<mx:script>
  <![cdata[
   import com.adobe.rtc.events.authenticationevent;
   import com.adobe.rtc.events.connectsessionevent;
   import com.adobe.rtc.events.sessionevent;
   import mx.core.iflexdisplayobject;
   import mx.managers.popupmanager;
  
   private const applicationtitle:string = "afcs sample application";
  
   private function init():void
   {
    sess.addeventlistener(sessionevent.error, oneventnotification);
    sess.addeventlistener(sessionevent.synchronization_change, oneventnotification);
    auth.addeventlistener(authenticationevent.authentication_failure, oneventnotification);
    auth.addeventlistener(authenticationevent.authentication_success, oneventnotification);
   
    popup(loginwindow);
   }
  
   private function popup(window:iflexdisplayobject):void
   {
    popupmanager.addpopup(window, this, false);
    popupmanager.centerpopup(window);
    window.visible = true;
   }

   /**
    * process afcs events
    */
   private function oneventnotification(p_event:event):void
   {
    if (p_event.type == sessionevent.synchronization_change) {
     if (sess.issynchronized) {
      //
      // issyncronized==true : connected room
      //
      panel.title = "connected room " + sess.roomurl;
      popupmanager.removepopup(loginwindow);
     } else {
      //
      // issyncronized==false : disconnected room
      //
      panel.title = applicationtitle;
      sess.roomurl = null;
      notificationmessage.text = "";
      //popup(loginwindow);
     }
    }
   
    else if (p_event.type == authenticationevent.authentication_success) {
     //
     // authentication succeeded
     //
     notificationmessage.text = "authentication succeeded";
    }
   
    else if (p_event.type == authenticationevent.authentication_failure) {
     //
     // authentication failed : bad password or invalid username
     //
     notificationmessage.text = "authentication failed";
    }
   
    else if (p_event.type == sessionevent.error) {
     //
     // generic session error, can happen if mispell account/room names
     // (serror.error.name == "invalid_instance" , serror.error.message == "invalid instance")
     //
     var serror:sessionevent = p_event sessionevent;
     notificationmessage.text = serror.error.message;
    }
   
    else
     notificationmessage.text = "got event " + p_event;
   }
  
   private function login():void
   {
    notificationmessage.text = "";
    auth.username = username.text;
    auth.password = passwordbox.visible ? password.text : null; // password==null : user guest
    sess.roomurl = roomurl.text; 
    sess.login();
   }
   private function logout():void{
    f.removeallchildren();
    sess.logout();
    this.parent.removechild(this);
   }
  ]]>
</mx:script>

  <!--
   | standard authenticator
   -->
<rtc:adobehsauthenticator id="auth"/>

  <!--
   | automatically promote guests can use application
   |
   | note: in order work, host needs enter room once enable pods
   | (enter room , go through various screens)
   -->
<rtc:roomsettings id="settings" autopromote="true"/>

<mx:panel id="panel" title="{applicationtitle}" width="100%" height="100%" paddingleft="5" paddingtop="5" paddingright="5" paddingbottom="5">

  <!--
   | login dialog box
   -->
  <mx:titlewindow id="loginwindow" title="connect room" visible="false">
   <mx:vbox>
    <mx:hbox>
     <mx:label text="room url:" width="70"/>
     <mx:textinput id="roomurl" width="295" tabindex="1">
      <mx:text>http://connect.acrobat.com/ncyumis/dddd</mx:text>
     </mx:textinput>
    </mx:hbox>
    <mx:hbox>
     <mx:label text="username:" width="70"/>
     <mx:textinput id="username" tabindex="2">
      <mx:text>guest</mx:text>
     </mx:textinput>  
     <mx:button label="login" click="login()" width="126" tabindex="4"/>
    </mx:hbox>
    <mx:hbox>
     <mx:hbox id="passwordbox">
     <mx:label text="password:" width="70"/>
     <mx:textinput id="password" displayaspassword="true" tabindex="3"/>
     </mx:hbox>
     <mx:radiobutton label="user" selected="true" click="passwordbox.visible = true"/>
     <mx:radiobutton label="guest" click="passwordbox.visible = false"/>
    </mx:hbox>
    <mx:text id="notificationmessage" text=""/>
   </mx:vbox>
  </mx:titlewindow>

  <!--
   | afcs application ui wrapped in connectsession
   --> 
  <rtc:connectsessioncontainer
   id="sess"
   authenticator="{auth}"
   initialroomsettings="{settings}"
   autologin="false" width="100%" height="100%" > 
   <mx:hbox width="100%" height="100%" horizontalgap="0">
    <mx:button label="logout" click="logout();"/>
    <mx:vbox>
     <mx:tabbar dataprovider="viewstack" direction="vertical" width="100" verticalgap="0"/>
     <!--mx:button label="disconnect" click="sess.close()"/-->
    </mx:vbox>

    <mx:viewstack id="viewstack" width="100%" height="100%" bordersides="left top right bottom" borderstyle="solid" borderthickness="2">
     <!--
      | chat pod , roster
      -->
     <mx:hbox label="chat" width="100%" height="100%">
      <rtc:simplechat width="60%" height="100%"/>
      <mx:list alternatingitemcolors="[#dfdfdf,#eeeeee]" dataprovider="{sess.usermanager.usercollection}" width="40%" height="100%" labelfield="displayname"/>
     </mx:hbox>
    
     <!--
      | camera/audio pod
      -->
     <mx:canvas label="audio/video" width="100%" height="100%">
      <rtc:webcamera left="0" right="0" top="0" bottom="0"/>
     </mx:canvas>
    
     <!--
      | whiteboard pod
      -->
     <mx:canvas label="whiteboard" width="100%" height="100%">
      <!-- strange reason shapestoolbar starts outside whiteboard canvas
       when whiteboard created move shapestoolbar should -->
      <rtc:sharedwhiteboard id="wb" left="0" right="0" top="0" bottom="0"
       creationcomplete="wb.shapestoolbar.move(0,0)"/>
     </mx:canvas>

     <!--
      | fileshare pod
      -->
     <mx:canvas id="f" label="fileshare" width="100%" height="100%">
      <rtc:fileshare left="0" right="0" top="0" bottom="0"/>
     </mx:canvas>
    </mx:viewstack>
   </mx:hbox>
  </rtc:connectsessioncontainer>
</mx:panel>
</mx:canvas>

hi,

 

in code use <session:roomsettings id="settings" autopromote="true"/>. note property     only works first time room receives connection user     owner role.

 

instead recommend set autopromote="true" either using devconsole or use line set after connect session synchronized

 

connectsession.primarysession.roommanager.autopromote = true;

 

hope resolves issue.

 

thanks

arun



More discussions in LiveCycle Collaboration Services


adobe

Comments

Popular posts from this blog

Help with codes to add 1 more shift register and add more to matrix LED

tcp client

Is there an HTML component in Flex 2.0?