AS3 - How to do a synchronous load of an asynchronous call?

前端 未结 4 847
小鲜肉
小鲜肉 2020-12-21 22:52

I have a function that loads a user object from a web service asynchronously.

I wrap this function call in another function and make it synchronous.

For exam

4条回答
  •  南方客
    南方客 (楼主)
    2020-12-21 23:47

    You can't convert async call into sync one without something like "sleep()" function and as far as I know it is missing in AS3. And yes, it is not guaranteed that newUser would contain user name before return statement.

提交回复
热议问题