Of course this won't work, it's an asynchronous call. You need to pass a reference to a callback method in your getValue() invocation and then you can do something with the return value there.
Thanks! I was in a hurry to make a working demo, so i misunderstood the documentation a bit, which says that a callback is
entirely optional. But as you said, this is an asynchronous call and now its strikes me!