0

I am developing a static flex application which does not have a database connection, all the values are hardcoded(its just a prototype for the original app). Now when i click the save button, i need to get a message like saving in progress... please wait, I need to display this message for 3 seconds.

Please let me know how could this be done.

Thanks!

Cheers,

Deena

3 Answers 3

1

I am putting in the complete code of how i did it for easy reference to other users.

First Create a savingProgressBar.mxml file with the progress bar with the required format.

Then in the parent page where you want the progress bar enter the following scrip code [In my parent page i click a button called save and on click of it i am calling the save() function]


              private var pBar:IFlexDisplayObject;

    private function save()
    {
        pBar=PopUpManager.createPopUp( this, savingProgressBar, true);
        PopUpManager.centerPopUp(pBar);

             var myTimer:Timer = new Timer(1500,1)
             myTimer.addEventListener(TimerEvent.TIMER, timerHandler);
             myTimer.start();
        }

        public function timerHandler(event:TimerEvent):void 
        {
       PopUpManager.removePopUp(pBar);
        }   
      ]]>

Hope this helps,

cheers,

Deena

0

Fist create a timer with:

private var t:Timer = new Timer(3000,1);

Then add an event lister to resond when the timer will be finished:

t.addEventListener(TimerEvent.TIMER_COMPLETE, removeMSG);
//start timer
t.start();

Add, removeMSG function that will remove your progress bar or notifier:

private function removeMSG(e:TimerEvent):void{
    //code to remove the notification
}

Also if you plan to use ProgressBar control in Flex use indeterminate="true" that will make progress bar move without any feedback data from your webservice

1
  • No problem, that is why g33ks are here for :)
    – Ladislav
    May 24, 2010 at 16:07
0

Use a timer that triggers every 200ms or something, and each time it triggers have it add 3s/200ms to the progress bar.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.