Skip to content

Instantly share code, notes, and snippets.

Created March 17, 2011 10:22
Show Gist options
  • Save anonymous/874120 to your computer and use it in GitHub Desktop.
Save anonymous/874120 to your computer and use it in GitHub Desktop.
function a( args ) {
// wysyłam do Flasha args
}
function b( myArgs ) {
// 5 sekund po otrzymaniu args, Flash wywołuje funkcję b( myArgs )
}
a(args);
// potrzebuję stworzyć funkcję c, która wykona funkcję a i zwróci wynik funkcji b
// PRZYKŁADOWE ROZWIĄZANIE
var wynik;
function b( myArgs ) {
wynik = myArgs;
}
function c( args ) {
a( args );
var waitFor = function() {
if ( !wynik ) { setTimeout( waitFor, 10 ); }
else { return wynik; }
}
setTimeout(waitFor, 10);
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment