Created
March 17, 2011 10:22
-
-
Save anonymous/874120 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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