views:

231

answers:

2

I want to store some test data for a FlexUnit test in small XML files in my Flex project, and access them trivially for the flex test. How can I load these bits of data synchronously? HTTPService is the way I'd be loading them _a_synchronously, but adding event handlers to my test cases seems like a bit of overkill.

A: 

To the best of my knowledge, there is no support for synchronous network & file I/O -- all such activity happens on the background thread, and is exposed to the main thread with event handlers.

Christian Nunciato
I should add that you can always construct workarounds to this, such that your app treats the call synchronously even if the underlying player code doesn't work that way. But chances are doing so would result in a good deal more code than you'd have with just the event handlers alone.
Christian Nunciato
+1  A: 

see this post for a similar sort of thing

http://stackoverflow.com/questions/1164257/load-xml-file-in-flex-before-application-start-intialises

Jon