I have this function in Flash:
public function checkFile(file:String):Boolean{
var b:Boolean;
var responder:Responder = new Responder(function(reply:Boolean):void{
b=reply;
msg("vid_"+file+".flv "+ "exists? " + reply);
setState("ready");
status = "ready";
},
function(res:Object):void{
trace("checkFile call failed");
});
mync.call("checkFile",responder,"vid_"+file);
return b;
}
I can confirm that the reply
variable is true, but return b
ends up false:
This is the javascript I use to call the flash function:
function checkFile(){
alert(thisMovie("vidRecorder").checkFile(currentVid));
}
And that opens up a message box saying false
, while the flash file displays true
What's going on? How can I fix it so that my function returns the same value as reply
?