It's hard to say w/o seeing what code is in what methods.  If you make a
RemoteObject request, there's no way it will return before the if
statement if all the code you showed is in one method.

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Scott
Sent: Sunday, July 27, 2008 9:36 PM
To: [email protected]
Subject: RE:[flexcoders] Value of AS variable dissapearing

 

Ok, I'm really not fully understanding what is happening here...

 

I decided to move on and come back to this issue.  So I started with
more validations on the form entries.  While testing the form fields I
started to get the email validation to show 'true' for finding a
duplicate email address in the remote DB. Why would this field not work
on the first form validation but the 2nd or on works just fine?

 

When I run the debug and set a breakpoint on the result function I see
that it's getting set to true.  When I continue to the if() statement in
another function in the same class instance it changes back to false.

 

Any ideas out there?

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Scott
Sent: Sunday, July 27, 2008 4:15 PM
To: [email protected]
Subject: {Disarmed} [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:method name="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:

 

            private function remote_result(event:ResultEvent):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?


-- 
This message has been scanned for viruses and 
dangerous content by MailScanner <http://www.mailscanner.info/> , and is

believed to be clean. 

 

Reply via email to