Sendandload hmmmmm

i want to check if a user is logged using sendandload from flash to php.this is code i’m using


var obj:Object = new Object();
function getLoggedStatus() {
    //Impelement XML SendAndLoad/////
    varSender = new LoadVars();
    varReceiver = new LoadVars();
    varSender.osCsid = _global.s_id;
    varReceiver.onLoad = function(success) {
        if (success) {
            trace("returning "+this.islogged);
            obj.islogged = this.islogged;//returned from main.php
            obj.username = this.username;//returned from main.php
            return (obj);
        } else {
            trace("failed");
        }
    };
    varSender.sendAndLoad("http//path/main.php", varReceiver, "GET");
    
}

saveImage_btn.onRelease = function() {
    var logStatus = getLoggedStatus();
    trace(logStatus.islogged);
}

when i test the code
trace("returning "+this.islogged); which is inside the onload function traces after trace(logStatus.islogged); which is inside onRelease of the button
so logStatus is undefined…

how can i eleminate this

thanks
:-/