8 Replies Latest reply on Jul 16, 2009 10:30 AM by injpix

    How to control Flex's repetitive tasks

    Zolotoj Level 3

      I have the following fragment:

       

      private function showIntelligence():void
      {     
             var popupWindow:TitleWindow = new TitleWindow;  
               popupWindow = c.showPopupWindow(DisplayObject(FlexGlobals.topLevelApplication), fusionChartsGroup);
               popupWindow.title = customer.text;
              var drillDowns:Object = new Object();
           drillDowns.drilldown_id = 1;
           drillDowns.drillorder = 1;
           addDrillDownChartsIntelligence(drillDowns, fusionChartsGroup(popupWindow));
      }  
      private function addDrillDownChartsIntelligence(drillDowns:Object, intelligence:fusionChartsGroup):void
      {
           intelligence.buildCharts(customer_id, drillDowns);                          
           if (drillDowns.drilldown_id < 3)
           {
                drillDowns.drilldown_id++;
                callLater(addDrillDownChartsIntelligence, [drillDowns, intelligence]);
           }     
      } 
      

      What's happening here is that intelligence.buildCharts will create two TitleWindows: A and B. In reality sometimes, B is created before A. How can I make sure that B is not created till A is created?

       

      Thanks