PHP won't return to flash


I’m using a loadVars and a sendAndLoad to call a php script. The php script has a socket connection to some other server, and that other server sends back something to my php page. Thing is, when it’s time to send back to flash, it seems like the php script took too much time to communicate with the other server, and flash always returns “undefined”. I’ve tested my php script out of flash and it just works… it returns some vars.
So how do i tell flash to wait? It seems like it does its Load too fast after its send.
Please help me :((