I had the same problem, but neither of the other solutions helped. Below is the code that produces the problem for me:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" applicationComplete="applicationComplete();">
<mx:Script><![CDATA[
import mx.controls.ProgressBar;
import mx.managers.PopUpManager;
private function applicationComplete():void
{
var progressBar:ProgressBar = new ProgressBar()
progressBar.indeterminate = true;
PopUpManager.addPopUp(progressBar, this, true);
//this.addChild(progressBar); including this line overrides the popup
//progressBar.setProgress(0, 0); including this line makes no difference
}
]]></mx:Script>
<mx:Label text="hello"/>
</mx:Application>
The two commented out lines are what I understood to be the other suggested solutions. I managed to fix this using the awkward workaround below:
Step 1: Create custom mxml component, saved as Progress.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:ProgressBar indeterminate="true" />
</mx:TitleWindow>
Step 2: Use custom component in code
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" applicationComplete="applicationComplete();">
<mx:Script><![CDATA[
import mx.controls.ProgressBar;
import mx.managers.PopUpManager;
import Progress;
private function applicationComplete():void
{
var progress:Progress = new Progress();
PopUpManager.addPopUp(progress, this, true);
PopUpManager.centerPopUp(progress);
}
]]></mx:Script>
<mx:Label text="hello"/>
</mx:Application>
It seems that putting the ProgressBar inside the TitleWindow is important.