PDA

View Full Version : progress bar


corbo950
07-02-2008, 06:18 PM
is is possible to show a progress bar as an alert? like have the alert pop-up and then show the progress bar with no buttons on the alert and then when the task is done have it automatically close or is this to much to ask?

box86rowh
07-03-2008, 04:33 PM
you cant do it with an alert, but you can design a custom mxml control with a progress bar and use the PopUpManager to show it modal (greys out the rest of the app)

corbo950
07-03-2008, 04:44 PM
how would i go about doing that... is there a example somewhere i can look at?

box86rowh
07-03-2008, 04:59 PM
First create a custom component with the following code :


<?xml version="1.0" encoding="utf-8"?>
<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="400" height="300">
<mx:ProgressBar x="90" y="116" id="pBar" mode="manual" minimum="0" maximum="100" />
</mx:TitleWindow>



then use the pop up manager to show it :

var pu:progress = new progress();
PopUpManager.addPopUp(pu, this, true);

then to update the bar use

pu.pBar.setProgress(....);

corbo950
07-03-2008, 05:14 PM
thanks a bunch that is perfect