--- In flexcoders@yahoogroups.com, "greg h" <[EMAIL PROTECTED]> wrote:
>
> Stephen,
> 
> Are you configured such that you can be in Flex Builder 2, then hit F11
> (same as Main Menu --> Run --> Debug)?
> 
> If you can run it this way the debug player communicates back to Flex
> Builder 2 and opens and points to the code where the error is being
thrown.
> Seeing where the error is often helps developers in resolving the
problem.
> If you can run it this way and are still unsure what the error is,
please
> post the block of code where the error is so that we can see it in
context.
> 
> Also, had you looked up in the Language Reference the class indicated:
> mx.messaging.messages.ErrorMessage
> 
> I have bookmarked the following top level URL for the Flex 2 Language
> Reference:
> http://livedocs.macromedia.com/flex/2/langref/
> 
> Looking up mx.messaging.messages.ErrorMessage, I see no "Property
message"
> on the class ErrorMessage.  The doc page for the class ErrorMessage
is here:
>
http://livedocs.macromedia.com/flex/2/langref/mx/messaging/messages/ErrorMessage.html
> 
> Returning to your original question:
> 
> >>  What could be the cause of this error?
> 
> It looks like there may be a statement in your code that is
referencing on
> an object a non-existent property "message".  Again if you can post the
> actual code it may be more clear.
> 
> Again, please post back more detail.
> 
> hth,
> 
> g
> 
> On 12/6/06, stephen50232 <[EMAIL PROTECTED]> wrote:
> >
> > Hi,
> >
> > I'm trying to deploy my first Flex application on a coldfusion server.
> > The login page of the application runs fine until I submit the form,
> > then I get a:
> >
> > Property message not found on mx.messaging.messages.ErrorMessage and
> > there is no default value.
> >
> > What could be the cause of this error?
> >
>
Hi everyone,

Thanks for the help so far. I've been looking at the code, and I
cannot find a reference to mx.messaging.messages.ErrorMessage any
where. What I have found is that the error is being caused by the
login functionality of the application. This was written by the
CF/Flex application wizard, not me. So I'm not 100% sure what part of
the code is causing the error.
The really wired thing is the login section works fine on my local
machine, but when it was moved over to the test machine the login
doesn't work.
As the login is a state of the main application I changed the start up
state to another, and now the application opens fine.

Anyway here is the Actionscript code for the login form:

import mx.events.ValidationResultEvent;
import mx.rpc.events.ResultEvent;
import mx.rpc.events.FaultEvent;
import mx.utils.ObjectUtil;
import mx.controls.Alert;

            
private var lso:SharedObject;
            
private function initApp():void
{
        this.lso = SharedObject.getLocal("auth");
        if( this.lso.data['email'] != null )
        {
                this.email.text = this.lso.data['email'];
                this.rememberLogin.selected = true;
        }
        if( this.lso.data['password'] != null )
        {
                this.password.text = this.lso.data['password'];
                this.rememberLogin.selected = true;
        }
}
            
private function isValid():Boolean
{
        var emailValidResult:ValidationResultEvent =
this.emailValidate.validate(this.email.text);
        var pswdValidResult:ValidationResultEvent =
this.pswdValidate.validate(this.password.text);
                
        if (emailValidResult.type==ValidationResultEvent.VALID 
                                && 
pswdValidResult.type==ValidationResultEvent.VALID) 
         {
                return true;    
         }
         else
         {
                return false;   
         }
}                        
            
private function authenticateUser():void
{
         if( isValid() )
         {
              authManager.login( this.email.text, this.password.text ); 
          }
} 
            
private function errorMessage(msg:String):void
{
    this.errorMsg.text = msg;
    this.errorMsg.height = 15;
    this.errorMsg.visible = true;
}    
   
private function serverFault(event:FaultEvent):void
{
    errorMessage(event.message['message']);
}   
            
                  
            
private function login_result(event:ResultEvent):void
{
    // login successful, remember the user.
    if( event.result == "true" )
    {
        if( this.rememberLogin.selected )
        {
                this.lso.data['email'] = this.email.text;
                this.lso.data['password'] = this.password.text; 
        }
        else
        {
                this.lso.data['email'] = null;
                this.lso.data['password'] = null;               
         }
                                        
                this.dispatchEvent( new Event('loginSuccessful') );
     }
     else
     {
          // login didn't work. show message
         errorMessage("Login unsuccessful");    
      }
}

Reply via email to