Search code examples
apache-flexactionscriptadobeloader

Best way to do loaders in a flex application?


What is the best way to do a loader in a flex application? I have an animated .gif that is to be used as our loader (whenever I need to wait for an action to complete), and I am not sure the best way to do it.

This is how I am thinking:

Have the loader be a custom component. On the parent application, add an event listener for my custom event AceEvent.SHOW_LOADER. In the event listener, use the PopUpManager to show the loader. Listen for AceEvent.HIDE_LOADER. Get rid fo the loader via PopUpManager.

What do you think about this? Is there a better way to do it?

Thanks!

Andrew


Solution

  • I ended up using as3gif (until I can get this recreated as a .swf). The way I do this is by using my custom event class (AceEvent.SHOW_LOADER and AceEvent.HIDE_LOADER), which bubbles up to the top. I then use the PopUpManager to add/remove this with modal to disable the application.