HI,
I'm trying to create an activity indicator that executes some functions in the background and then closes automatically.
The problem I face is that the activity indicator closes before completion because the functions are called asynchronously.
When the window activity indicator opens and completes the layout process then is being executed the function with all the sub functions included there.
pActivityIndicator.addEventListener('postlayout', executeProcess);
//background processes function executeProcess() { function call1() { //do a process //call another function here... call3(); } function call2() { //do something 2 call4(); } call1(); call2(); pActivityIndicator.close(); }