I have written an Air application in Flex 3. Its designed to copy files to a new location and build new files from templates. It works fine and does the job however visually its pretty bland and does not give any indication outside of Flex Builder that its doing anything. In fact the Air window its in goes transparent and it looks like its crashed.
I have tried using a timer and setInterval to update a graphic indication that something is happening but these events just seem to be ignored while the application is churning through copying and moving files.
Any idea how to get some sort of visual feedback or force a screen refresh?
Are you using the synchronous file methods? These are "blocking" and will prevent the display from updating. Using the asynchronous methods for reading and writing the files should fix the problem. (If there are really a lot of files, then just processing them in a loop can make the app unresponsive even if the actual file operations are async -- but using a timer so that you only process a smaller group of files at a time should fix that issue.)
I've taken your advice when working on a new application and swapped out the for loop for a timer driven event instead. This has certainly allowed for a more visual app. Thanks for your help.