Not sure if this has anything to do with your problem, but it looks as though 
you have two different function set up to handle the result: remote_result and 
register_result. I wonder if maybe one of them is overriding the other.



----- Original Message ----
From: Scott <[EMAIL PROTECTED]>
To: [email protected]
Sent: Sunday, July 27, 2008 2:15:13 PM
Subject: [flexcoders] Value of AS variable dissapearing


I’ve got a weird issue that I’m trying to track
down… It’s all part of the life of a class instance that I posted
before (I’ve got an update on that one coming soon).
 
In my user registration validation class, I check to see if
the email address already exists in the DB.  I created a CFC function called
val_email( string:strEMail) :Boolean
 
My remote object is defined as:
    <mx:RemoteObject
        id="authManager" 
        destination="ColdFusion" 
        source="FT.components. cfgenerated. managers. Auth"
        result="remote_result( event)">
       <mx:methodname="register" result="register_result( event)"
fault="serverFault( event)" />
    </mx:RemoteObject>
 
In my AS script I have the following config:
<mx:Script>
  <![CDATA[
            Import …
 
            private var bEMail:Boolean;
 
So that declares the variable that I’ll be watching.
 
I basically do the following during validation:
If (
ValidEmailAddress )
authManager. val_email( this.email.text );
 
if (this.bEMail == true )
{
      … give error message/handing duplicate…
Etc…
 
 
The function:
 
            privatefunctionremote_result( event:ResultEven t):void
            {
                  this.bEMail = event.result;
            }
 
 
Fires off ok and
sets the variable this.bEMail to “true” just fine.  I have a watch
set on the variable and see that it gets set.
 
Now, when it
returns to the above if statement bEMail is back to false.  I’ve tried to
run line by line in the debugger and can’t find anything that is causing
a reset.  I can also see the watched variable went from true to false.  Anyone
have any suggestions?    


      

Reply via email to