Hi, everyone
here is my code for login of username and password.
its showing an error in the script part of the code.can u help  me in
making it an error free code.


<?xml version="1.0" encoding="utf-8"?>

<mx:Script>
    <![CDATA[
        public function login()
        {
         if(textinput2.text=="MLRIT" && t2.text=="MLRIT")
          currentState='Register';

        else
         Alert.show(event.fault.tostring());

}
    ]]>
</mx:Script>
    <mx:states>
        <mx:State name="Register">
            <mx:AddChild relativeTo="{t2}" position="lastChild">
                <mx:Label x="31" y="84" text="Email id"/>
            </mx:AddChild>
            <mx:AddChild relativeTo="{t2}" position="lastChild">
                <mx:TextInput x="81" y="82" width="149"/>
            </mx:AddChild>
            <mx:SetProperty target="{t2}" name="title"
value="Registration"/>
            <mx:RemoveChild target="{linkbutton1}"/>
            <mx:AddChild relativeTo="{t2}" position="lastChild">
                <mx:LinkButton x="22" y="130" label="Home"
click="currentState='Home'"/>
            </mx:AddChild>
        </mx:State>
        <mx:State name="Home">
            <mx:SetProperty target="{t2}" name="title" value="Home"/>
            <mx:RemoveChild target="{label1}"/>
            <mx:RemoveChild target="{label2}"/>
            <mx:RemoveChild target="{textinput2}"/>
            <mx:RemoveChild target="{linkbutton1}"/>
            <mx:SetProperty target="{t2}" name="width" value="404"/>
            <mx:SetProperty target="{t2}" name="height" value="276"/>
            <mx:AddChild relativeTo="{t2}" position="lastChild">
                <mx:Image x="0" y="0" width="166" height="122"
source="img/Water lilies.jpg"/>
            </mx:AddChild>
            <mx:RemoveChild target="{button1}"/>
            <mx:AddChild relativeTo="{t2}" position="lastChild">
                <mx:Button x="182" y="158" label="Logout"
click="currentState=''"/>
            </mx:AddChild>
        </mx:State>
    </mx:states>
    <mx:Panel x="69" y="55" width="343" height="212" layout="absolute"
title="Login" id="t2">
        <mx:Label x="10" y="22" text="Username" id="label1"/>
        <mx:Label x="10" y="58" text="password" id="label2"/>
        <mx:TextInput x="80" y="20" width="150" id="textinput2"/>
        <mx:Button x="215" y="130" label="Login" id="button1"/>
        <mx:LinkButton x="42" y="130" label="Register"
id="linkbutton1" click="'login()'"/>
        <mx:TextInput x="74" y="56"/>
    </mx:Panel>

</mx:Application>

Thank you in Advance.
                                     -GEETHA

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to flex_india@googlegroups.com
To unsubscribe from this group, send email to 
flex_india+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to