Hi there,

one possible way is to set a viewstack that switchs between your login and your 
main application.
You'll set your variable as false when you declare it and when getting the 
respose from login as logged you just need to set the variable = true. Then the 
bindings with do their work.

<mx:Viewstack selectedChild="{someFunction(isLogged)}">
<mx:SomeContainerWithLoginForm id="SomeContainerWithLoginForm"/>
<mx:SomeContainerWithApplication id="SomeContainerWithApplication"/>
</mx:Viewstack>

ActionScript
var isLogged:Boolean=false;

function someFunction(logged:Boolean){
 if (logged) {
    return SomeContainerWithApplication;
 }else{
    return SomeContainerWithLoginForm;
 }
}


Regards,

João Fernandes


-----Original Message-----
From: [email protected] on behalf of Jeremy Rottman
Sent: Tue 13-Sep-05 12:43 AM
To: [email protected]
Subject: [flexcoders] Re: userlogin
 
Ok I think I got the log in working now, but the next question I have
is how to to send them to a new page if they are logged in. 

--- In [email protected], "Malcolm" <[EMAIL PROTECTED]> wrote:
> Have you tried passing a NULL as your last argument? I know this sounds
> strange, but it works when using remote objects (AMF), not too sure
if the
> same goes for cf web services.
> 
> Thus your call in as will look like this:
> 
> srv.qpUserLogin(usr, pss, NULL);
> 
> And in your cfc arguments define a 'FlexNULL' or something similar:
> 
> <cffunction name="qpUserLogin" access="remote" hint="from
> tbl_smartPanel_users" returnType="string" output="false">
>       <cfargument name="usr" type="string" required="true" />
>       <cfargument name="pss" type="string" required="true" />
>       <cfargument name="FlexNull" type="any" required="no" default="">
> 
> 
>       <!--- your code here --->
> 
> </cffunction>
> 
> Post on it here:
> 
>
http://www.flexingcfmx.com/index.cfm?mode=entry&entry=D36D5CE5-FB00-283B-A23
> A89CB46949A4D
> 
> Hope this helps :]
> 
> -----Original Message-----
> From: [email protected] [mailto:[EMAIL PROTECTED] On
> Behalf Of Jeremy Rottman
> Sent: Tuesday, 13 September 2005 7:56 AM
> To: [email protected]
> Subject: [flexcoders] userlogin
> 
> I am working on a simple test user login, and I am having a butt load
> of trouble with it. When I test the code, it tells me that element usr
> is undefined in my argument. You can see the file here. Does anyone
> know of a tutorial using cf?
> http://70.97.113.6/flex/
> 
> Here is my code.
> 
> CF--
> <cffunction name="qpUserLogin" access="remote" hint="from
> tbl_smartPanel_users" returnType="string" output="false">
>             <cfargument name="usr" type="string" required="true" />
>             <cfargument name="pss" type="string" required="true" />
>             <!-- Query for pulling userinfo based on what was passed
> from as -->
>             <cfquery name="qpGetLogin" datasource="#application.dsn#">
>                select * from tbl_smartPanel_userList
>                where fld_userlogin='#argument.usr#'           
>                and fld_userpass='#argument.pss#'
>             </cfquery>
>             <cfif qSecurity.recordcount gt 0>
>                   <cfset access="T">
>             <cfelse>
>                   <cfset access="F">
>             </cfif>
>             
>       
>             <cfreturn access />
> 
>       </cffunction>      
> 
> AS--
> // ActionScript Document
> 
> function qpUserLogin(usr, pss) {
> srv.qpUserLogin(usr, pss);
> }
> 
> Flex--
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml";>
> <mx:WebService id="srv"
> wsdl="http://70.97.113.6/test/smartPanel.cfc?wsdl";>
> </mx:WebService>
> <mx:Script source="login.as" />
> <mx:Form>
> <mx:FormItem label="Username" required="true">
> <mx:TextInput id="usr" />
> </mx:FormItem>
> 
> <mx:FormItem label="Password" required="true">
> <mx:TextInput id="pss" />
> </mx:FormItem>
> </mx:Form>
> 
> <mx:ControlBar horizontalAlign="right">
> <mx:Button label="Submit"
> click="qpUserLogin(usr.text, pss.text);" />
> </mx:ControlBar>
> </mx:Application>
> 
> 
> 
> 
> 
> 
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com 
> Yahoo! Groups Links





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 



________________________________

YAHOO! GROUPS LINKS 


        *        Visit your group "flexcoders 
<http://groups.yahoo.com/group/flexcoders> " on the web.
          
*        To unsubscribe from this group, send an email to:
         [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> 
          
*        Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service 
<http://docs.yahoo.com/info/terms/> . 


________________________________




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

<<winmail.dat>>

Reply via email to