Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SimpleChat issue

Avatar

Level 1

Hi everyone,

I just got the latest build and the AFCS Navigator, very cool stuff ... congrats to the team working on this.

I'm using a SimpleChat instance in my application and I noticed this strange behavior :

When you type in text in the text input and press the enter key, the text input does not "get cleared", whereas if you type on the send button, the text gets cleared, I tried override the SimpleChat class, and overrideing the sendNewMessage method, but I don't think that's the correct way to do it so I just wanted to post this here

Thanks for the help

Julien

6 Replies

Avatar

Level 10

Hi,

can you just send a small code that does this. Because I built an example with the latest build for SImpleChat and it works fine for me for both player 9 and player 10 swc.

Here is the attached code . Please let us know whether this works for me.

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    layout="absolute"
    backgroundColor="0xcccccc"
    width="800" height="500" 
    xmlns:rtc="AfcsNameSpace">
   
    <mx:Script>
        <![CDATA[
           
        ]]>
    </mx:Script>
   
    <!--
        You would likely use external authentication here for a deployed application;
        you would certainly not hard code Adobe IDs here.
    -->
    <rtc:AdobeHSAuthenticator
        id="auth"
        userName="username"
        password="password"  />
   
    <rtc:ConnectSessionContainer roomURL="url" id="cSession" authenticator="{auth}"
         width="100%" height="100%">
        <mx:VBox width="100%" height="100%" id="vBox">
            <rtc:SimpleChat width="200" height="200"/>
        </mx:VBox>
    </rtc:ConnectSessionContainer>
</mx:Application>

Thanks

Hironmay Basu

Avatar

Level 1

Of course, I have several files, basically, I was following the video tutortials that ship with the sdk

This is the main mxml file :

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    xmlns:rtc="AfcsNameSpace" xmlns="*"
    backgroundColor="#ffffff" backgroundGradientAlphas="[0, 0]"
    creationComplete="creationCompleteHandler()">
    
    <mx:Script>
        <![CDATA[
            import mx.managers.PopUpManager;
            
            protected var loginDialog:LoginDialog;
            
            protected function creationCompleteHandler():void
            {
                loginDialog = new LoginDialog();
                loginDialog.connectSession = connectSession;
                loginDialog.addEventListener("login", loginHandler);
                PopUpManager.addPopUp(loginDialog, this);
                PopUpManager.centerPopUp(loginDialog);
        
            }
            
            protected function loginHandler(event:Event):void
            {
                PopUpManager.removePopUp(loginDialog);
            }
        ]]>
    </mx:Script>
    
    <rtc:AdobeHSAuthenticator id="authenticator" />
    
    <rtc:ConnectSessionContainer id="connectSession" 
        width="100%" height="100%" autoLogin="false"
        roomURL="http://connectnow.acrobat.com/julienc/whiteboard" 
        authenticator="{authenticator}" >
        <mx:HBox width="100%" height="100%" 
            horizontalAlign="center" horizontalScrollPolicy="off" 
            verticalAlign="middle" verticalScrollPolicy="off">    
            <mx:VDividedBox width="80%" height="100%" 
                horizontalScrollPolicy="off" 
                verticalScrollPolicy="off">
                <rtc:SharedWhiteBoard id="whiteboard" width="100%" height="80%" />        
                <rtc:SimpleChat id="chat" width="100%" height="20%" />
            </mx:VDividedBox>
            <rtc:Roster id="roster" width="20%" height="100%" />
        </mx:HBox>
    </rtc:ConnectSessionContainer>
</mx:Application>

<?xml version="1.0" encoding="utf-8"?>
<mx:Panel xmlns:mx="http://www.adobe.com/2006/mxml"
    title="Login with a username" width="300" height="100" 
    horizontalAlign="center" horizontalScrollPolicy="off"
    paddingBottom="10" paddingLeft="10" paddingRight="10" paddingTop="10"
    verticalAlign="middle" verticalScrollPolicy="off">
    
    <mx:Metadata>
        [Event(name="login")]
    </mx:Metadata>    
        
    <mx:Script>
        <![CDATA[
            import com.adobe.rtc.session.IConnectSession;
            
            [Bindable]
            public var connectSession:IConnectSession;
            
            protected function loginHandler():void
            {
                if (userName.text == null || userName.text.length < 1)
                    return;
                
                connectSession.authenticator.userName = userName.text;
                connectSession.login();
                
                callLater(function():void { userName.text = "" });
                
                var e:Event = new Event("login");
                dispatchEvent(e);
            }
        ]]>
    </mx:Script>    
        
    <mx:HBox width="100%" height="100%"
        horizontalAlign="center" horizontalScrollPolicy="off"
        verticalAlign="middle" verticalScrollPolicy="off">
        <mx:Label text="Username :" fontWeight="bold" />
        <mx:TextInput id="userName" width="100%" enter="loginHandler()" />
        <mx:Button label="Login" click="loginHandler()" />    
    </mx:HBox>
</mx:Panel>

Avatar

Level 10

Hi ,

I modifed your example a bit and ran the code ( i will paste what i ran) and it works . Are you using the right swc. After you install the Navigator app, unzip the content and then use the swc from inside it.

Here is what i ran (your example )

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    xmlns:rtc="AfcsNameSpace" xmlns="*"
    backgroundColor="#ffffff" backgroundGradientAlphas="[0, 0]"
    >
   
    <mx:Script>
        <![CDATA[
            /*import mx.managers.PopUpManager;
           
            protected var loginDialog:LoginDialog;
           
            protected function creationCompleteHandler():void
            {
                loginDialog = new LoginDialog();
                loginDialog.connectSession = connectSession;
                loginDialog.addEventListener("login", loginHandler);
                PopUpManager.addPopUp(loginDialog, this);
                PopUpManager.centerPopUp(loginDialog);
       
            }
           
            protected function loginHandler(event:Event):void
            {
                PopUpManager.removePopUp(loginDialog);
            }*/
        ]]>
    </mx:Script>
   
    <rtc:AdobeHSAuthenticator id="authenticator" userName="your login" password="your password" />
   
    <rtc:ConnectSessionContainer id="connectSession"
        width="100%" height="100%"
        roomURL="your room url"
        authenticator="{authenticator}" >
        <mx:HBox width="100%" height="100%"
            horizontalAlign="center" horizontalScrollPolicy="off"
            verticalAlign="middle" verticalScrollPolicy="off">   
            <mx:VDividedBox width="80%" height="100%"
                horizontalScrollPolicy="off"
                verticalScrollPolicy="off">
                <rtc:SharedWhiteBoard id="whiteboard" width="100%" height="80%" />       
                <rtc:SimpleChat id="chat" width="100%" height="20%" />
            </mx:VDividedBox>
            <rtc:Roster id="roster" width="20%" height="100%" />
        </mx:HBox>
    </rtc:ConnectSessionContainer>
</mx:Application>

And I can't find the problem , so just check the right swc.

Hope this helps.

Thanks

Hironmay Basu

Avatar

Level 1

Hi again,

And thanks for your code and help

I think I wasn't clear in my description. For me, everything's working fine except on little issue, I put the swf file online so that you could test for yourself, the problem I'm having is that when you hit the "enter" key in the textinput to send a message through the chat, the text in the text input (the message you typed) stays there, and if you click the send button, the text in the text input gets cleared. You can view this here, http://punkscum.org/stuff/whiteboard/ just login with a username and once connected, type a message in the text input and hit the enter key, the message gets sent to the "server" but, the text stays there, and then try the same but click the send button.

Thanks again

Avatar

Level 10

Can you please confirm first that you are able to reproduce your problem with the example I gave you , which is nothing but taken from your code. And use the latest swc in the navigator app.

Thanks

Hironmay Basu

Avatar

Level 1

Hello,


I compiled the code bellow with the two .swcs that are given in the AFCS SDK Navigator Air application (player9 and player10)

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    xmlns:rtc="AfcsNameSpace"  >


    <rtc:AdobeHSAuthenticator id="authenticator" userName="your login" password="your password" />
  
    <rtc:ConnectSessionContainer id="connectSession"   width="100%" height="100%"
        roomURL="your room url"    authenticator="{authenticator}" >
    
        <rtc:SimpleChat id="chat" width="100%" height="100%" />


    </rtc:ConnectSessionContainer>


</mx:Application>

So that's just a SimpleChat instance right in the ConnectSessionContainer, nothing really adavanced, just the basics

I also recorded a video of my screen, to show you exactly what is happening, that is, when the enter key is pressed in the SimpleChat instance the text does not get cleared,

You can view this video here : http://vimeo.com/5813985
or here :  http://www.punkscum.org/stuff/simplechat_example.ogg


so far I tested this on Windows XP and Ubuntu Linux 9.0.4 and I have the same result, I'm going to go ask a friend to test and compile this on his Mac, but for me the, the "behavior" is the same ...

I also checked the source, and in the com.adobe.rtc.pods.SimpleChat class, in the sendNewMessage method, adding,
callLater( function():void { _newMessage.text = "";  } ) fixes this issue.

I'm not complaining, I just think that if the text is cleared when we click the "send" button, it should be also cleared, when we press the "enter" key in the chat's text input.

Thanks

Julien