Expand my Community achievements bar.

Problem in LOginDialog

Avatar

Former Community Member

Hi, I have a question about logindialog i want to add userName/ Password to air chat applcation however i study example that in sampleApps(YahooMaps/logindialog) so later i tried to follow the same steps in example and work fine but have one thing only after i create by this way

In code :

public function get userName():String
            {
                return userNameField.text;
            }
           
            public function get password():String
            {
                return (_passwordField.text!="") ? _passwordField.text : null;
            }

and :

<mx:Label x="274" y="158" text="Enter Your User Name:" includeIn="login"/>
    <mx:TextInput id="userNameField" x="233" y="187" enter="dispatchEvent(new Event('loginEnter'))" creationComplete="userNameField.setFocus();" width="263" includeIn="login " height="36"/>
    <mx:Button x="317" y="309" label="Login" click="dispatchEvent(new Event('loginEnter'))" includeIn="login" height="33" width="89"/>
    <mx:Label x="287" y="231" text="Password (optional):" includeIn="login" width="123"/>
    <mx:TextInput x="233" y="250" width="263" id="_passwordField" displayAsPassword="true" enter="dispatchEvent(new Event('loginEnter'))" includeIn="login" height="36"/>

and also i create state name is "Login" run code and work fine the problem is when i typing in username label adob account user name also password and click login button applet not login and stay open the same window without enter to chat applcation.

any ideas

thanks,

7 Replies

Avatar

Former Community Member

Hi, guys if have some help  abouot my question will be nice i really need help!

Thanks,

Avatar

Former Community Member

Hi Jannaahmed,

I don't really see how we can help you based on what you posted. We really

do want to help folks, but you expect a little too much from us.

nigel

Avatar

Former Community Member

Hi nigel, thanks to answer i really do like example in yahoo map (logindialog) and is work fine the problem is when i typing username and password to enter

For applcation, click login to appcation no accept enter and stay open the same window.

If have any help  can guide me to the wrong that i did will be nice, by the way LCCS team always help!!

Avatar

Employee

Hi,

In your code, you are dispatching this event for your login dialog- dispatchEvent(new Event('loginEnter'))"

Are you catching that event somewhere and associate your login action to that event ?

As Nigel mentioned, this more or Flex question than LCCS question.

Thanks

Arun

Avatar

Former Community Member

Hi Arun , thanks to help as i said i copy this example from simple example in LCCS (YahooMaps) however I finish the applcation and thanks too much

To each one in LCCS, as i said before they do a good job.

I do every thing like example but is dosent work i tried many times to solve but no succeed.

Here is the code completly :- may can help

Thanks,

<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
                       xmlns:s="library://ns.adobe.com/flex/spark"
                       xmlns:mx="library://ns.adobe.com/flex/mx" width="720" height="517" xmlns:rtc="http://ns.adobe.com/rtc"
                       creationComplete="initApp()"
                       xmlns:collab="com.adobe.rtc.collaboration.*" xmlns:session="com.adobe.rtc.session.*" xmlns:authentication="com.adobe.rtc.authentication.*" xmlns:pods="com.adobe.rtc.pods.*" backgroundColor="#A8A3A3">
    <fx:Style source="Chat.css"/>
    <!--<fx:Style source="Main.css"/>-->
    <fx:Metadata>
        [Event(name="loginEnter", type="flash.events.Event")]
    </fx:Metadata>
   
   
    <fx:Script>
        <![CDATA[
           
            import mx.events.CloseEvent;
            import mx.controls.Alert;
           
            import com.adobe.rtc.core.connect_internal;
            import com.adobe.rtc.core.session_internal;
           
           
            protected function button1_clickHandler(event:MouseEvent):void
            {
                // TODO Auto-generated method stub
                scshare.publish();
            }
           
            protected function button2_clickHandler(event:MouseEvent):void
            {
                // TODO Auto-generated method stub
                scshare.stop();
               
            }
           
            private function onAudioClick(p_evt:MouseEvent):void
            {
                if ( p_evt.currentTarget.label == "Start My Audio" ) {
                    audioPub.publish();
                    p_evt.currentTarget.label = "Stop My Audio" ;
                }else if (p_evt.currentTarget.label == "Stop My Audio" ){
                    audioPub.stop();
                    p_evt.currentTarget.label = "Start My Audio" ;
                }
            }
           
            private function onVideoClick(p_evt:MouseEvent):void
            {
                if ( p_evt.currentTarget.label == "Start My Video" ) {
                    webCamPub.publish();
                    p_evt.currentTarget.label = "Stop My Video" ;
                }else if (p_evt.currentTarget.label == "Stop My Video" ){
                    webCamPub.stop();
                    p_evt.currentTarget.label = "Start My Video" ;
                }
            }
           
            protected function button3_clickHandler(event:MouseEvent):void
            {
                // TODO Auto-generated method stub
            }
           
           
            private function initApp():void
            {
                this.addEventListener(Event.CLOSING, onLogout);
            }
           
            private function onLogout( event:Event ):void
            {
                event.preventDefault();
                Alert.yesLabel = "Yes";
                Alert.noLabel = "No";
                Alert.show("You Want to Exit?","Logout", Alert.YES|Alert.NO, this, alertHandler, null, 2);
            }
           
            private function alertHandler( event:CloseEvent ):void
            {
                if( event.detail == Alert.YES)
                {
                    this.nativeApplication.exit();
                }
            }
           
        ]]>
    </fx:Script>
   
    <fx:Script>
        <![CDATA[
            [Bindable]
            [Embed("assets/Mic.png")]
            private var Mic:Class;
           
            [Bindable]
            [Embed("assets/logout.png")]
            private var Mute:Class;
           
            [Bindable]
            [Embed("assets/webcam.png")]
            private var webcam:Class;
           
        ]]>
    </fx:Script>
   
    <fx:Script>
        <![CDATA[
            public function get userName():String
            {
                return userNameField.text;
            }
           
            public function get password():String
            {
                return (_passwordField.text!="") ? _passwordField.text :null;
            }
        ]]>
    </fx:Script>
    <s:states>
        <s:State name="State1"/>
        <s:State name="login"/>
    </s:states>
   
    <!--<mx:Image x="0" y="0" width="100%" height="800" source="background.png" scaleContent="true"/>-->
    <session:ConnectSessionContainer height="530" roomURL="https://collaboration.adobelivecycle.com/account/room" width="720" y="0" x="0" includeIn="State1">
        <session:authenticator>
            <rtc:AdobeHSAuthenticator id="auth" userName="name@mail.com" password="pass"/>
        </session:authenticator>
        <pods:Roster x="392" y="0" displaySelection="false" showMenuButtons="false"  width="313" height="362" chromeColor="#B6B6BD" color="#676363" contentBackgroundAlpha="0.76"/>
        <collab:AudioSubscriber id="audioSub" height="0"/>
        <collab:AudioPublisher id="audioPub" height="0"/>
        <collab:WebcamPublisher width="0" height="0" id="webCamPub" resolutionFactor="5" quality="80"/>
        <collab:WebcamSubscriber width="120" height="120" displayUserBars="false" x="0" y="0"/>
        <collab:ScreenSharePublisher id="scshare"  width="421" height="309" left="484" y="207"/>
        <collab:WebcamSubscriber width="162" height="129" id="webcamSubMe" webcamPublisher="{webCamPub}" displayUserBars="false" x="393" y="362"/>
       
        <s:Button x="557" y="363" click="button1_clickHandler(event)" label="share screen" width="141" height="41" color="black" fontWeight="bold" chromeColor="#9595D3"/>
        <s:Button x="556" y="410" click="button2_clickHandler(event)" label="stop screen sharing" width="141" height="41" fontWeight="bold" color="#040404" chromeColor="#9595D3"/>
        <mx:Button x="623" y="454" label="Start My Audio" click="onAudioClick(event)" toggle="true" width="28" height="38" enabled="true" icon="@Embed(source='assets/Mic.png')"/>
        <mx:Button x="666" y="454" label="Logout" click="onLogout(event)" toggle="true" width="30" chromeColor="#85BF85" enabled="true" height="36.5" icon="@Embed(source='assets/logout.png')"/>
        <mx:Button x="570" y="453" label="Start My Video" click="onVideoClick(event)" enabled="true" toggle="true" labelPlacement="left" width="30" height="39.2" icon="@Embed(source='assets/webcam.png')"/>
        <rtc:SimpleChat x="-1" y="0" sessionDependent="true" useExternalContextMenu="false" newMessageColor="0x000000" width="393" height="492" chromeColor="#CCCCCC"/>
        <!--<pods:SimpleChat x="0" y="0"  sessionDependent="true" useExternalContextMenu="true" newMessageColor="0x000000" width="395" height="496" chromeColor="#139FA1"/>-->           
           </session:ConnectSessionContainer>
   
    <mx:Image includeIn="login" x="0" y="0" width="720" height="517" source="background.png" scaleContent="false"/>
    <mx:Label text="Enter Your User Name:" x="278" y="148"  includeIn="login"/>
    <mx:TextInput id="userNameField" textAlign="center" fontWeight="bold" enter="dispatchEvent(new Event('loginEnter'))" creationComplete="userNameField.setFocus();" x="257" y="177" width="198" height="31" includeIn="login"/>
    <mx:Button label="Login" click="dispatchEvent(new Event('loginEnter'))" x="321" y="337" height="35" width="75" includeIn="login"/>
    <mx:Label text="Password (optional):" x="289" y="244" includeIn="login"/>
    <mx:TextInput id="_passwordField" textAlign="center" fontWeight="bold" displayAsPassword="true" enter="dispatchEvent(new Event('loginEnter'))" x="261" y="271" width="198" height="31" includeIn="login"/>
   
   
</s:WindowedApplication>

Avatar

Former Community Member

Janna,

Sorry, we can't help you here. I'd suggest you go take some Flex classes.

Arun just told you exactly what your problem was, and you responded by

posting all your code. This is NOT acceptable use of the forums.

nigel