Phate
Phate

Reputation: 6612

blocking url loader

I need to load some images at run time, but I can't use events as I have a code block like this:

loader.load(request);
//do something with loaded resource

I'd like to avoid an active wait with a

  while (condition) <sleep>

cycle...isn't there a way to make load() method blocking?

Upvotes: 0

Views: 259

Answers (1)

Antoine Lassauzay
Antoine Lassauzay

Reputation: 1607

No you can't. Flash is non blocking by nature. Being single-threaded, this is the only way to allow the application to respond to user events and update the screen while doing I/O. Even though Workers were added to the lastest versions of the Flash Player, they still don't allow you do synchronous stuff like that.

Upvotes: 2

Related Questions