Topic: Problems with Flash sendToURL, navigateToURL and Ruby redirectTo ...

Hallo,
I want to create a login menu.
Therefore I have two flash textfields and one button. If the Button is pressed, this code is running (more or less)

Code:

private function login(event:MouseEvent){

        //bei anderer URL anpassen.
        var request:URLRequest = new URLRequest("http://localhost:3000/portfolio/login");
        // Create some variables to send, someText and someNumber.
          var variables:URLVariables = new URLVariables(  );
          variables.username = user.text;
        variables.pass = pass.text;
       
        var loader:URLLoader = new URLLoader();
        // Configure the loader to load URL-encoded variables
        loader.dataFormat = URLLoaderDataFormat.VARIABLES;
        loader.addEventListener(Event.COMPLETE, requestLogin);
        loader.addEventListener( IOErrorEvent.IO_ERROR, handleIOError );
        loader.addEventListener( HTTPStatusEvent.HTTP_STATUS, handleHttpStatus );

       
        request.method = URLRequestMethod.POST;
        // Set the data to be sent to the variables, created earlier
          request.data = variables;
        // Send the data to the script for processing
        //sendToURL( request );
        navigateToURL(request,"_self");
       
        //loader.load(request);

        }


The URL in URLRequest is linking my local host...
At the line end, I try to post the content of the textfields via sendToURL(), navigateToUrl() or load.loader() to my ruby script. But thats not working.

This is what happens:
sendToUrl() is sending the data,  but in ruby, the code is blocking near the authentisation, take a look:

Code:

      if request.post?
        puts "request post"
        user = User.authenticate(params[:username], params[:pass])
       
        if user
          puts "user gefunden..."
           redirect_to :action => "catwalk", :sessionname => user.username
        // puts "user gefunden...ende"
        else
          puts "Fehler: user nicht gefunden!"
           flash[:notice] = "Invalid user/password combination"
             redirect_to :action => "login"

        end
    end

First IF is true (request), so enter this block. puts ist working, IF user also true and working, puts is running.
The Linking "redirect to..." is not working when I use the AS3 method sendToURL().
With navigatetoUrl() its working ( redirectTo ), but thats a double linking, I want to  avoid that. And I dont want to navigate the side in this case by flash, because flash dont no at this time if the user is authenticated or not.

in both cases the last puts is working (the currently outcommented one)

what is the exact problem with sendToURL() ?

URLLoader.load() is not working at all...

best regards

knut

Re: Problems with Flash sendToURL, navigateToURL and Ruby redirectTo ...

check this line...
var loader:URLLoader = new URLLoader();

next.. what's with the request?