zihaoyu
zihaoyu

Reputation: 5721

Flex - how to create a lightbox-style loading?

My application's creationComplete="onInit()" has a lot of processing. Therefore I want to mask the entire application with a lightbox-style loading screen while the processing is being handled. The screen should be dark and a loading animation image in the center. After onInit() is completed the loading screen is removed.

My thoughts are to add a UIComponent to the stage, and to remove it at the end of onInit(). I am not sure if this is do-able or is there a better way. Thanks.

Upvotes: 0

Views: 513

Answers (1)

JeffryHouser
JeffryHouser

Reputation: 39408

What is the initial processing you need o accomplish? Would it be more effecient to move it into initialize, preinitalize, or even a class constructor, instead of putting it creatonComplete?

That said, there is no reason you can't keep things hidden with the visible property, and swap that after your initialization routine is done. There is also no reason you can't hide items under another component until your processing is done.

Upvotes: 1

Related Questions