0 Replies Latest reply on Aug 14, 2009 9:09 AM by joshs451

    Tabnavigator with swfloader problem

    joshs451

      Hello,

       

      I'm trying to run a tabnavigator component with each tab having a separate swfloader.  Each swfloader is a different datagrid that I populate with the SystemManager.application['functionName'] = 'parameters' method.

       

      My problem is that when I a few tabs, only the very last tab's datagrid will have data, and the others will be blank.  What's wrong with it?

       

                  public var matrixLoader:SWFLoader;

                  public function addTab(tabName:String, swfURL:String, setFunc:Array, searchString:Array):void {

                      var tabCanvas:Canvas = new Canvas();
                      tabCanvas.label = tabName;
                      tabCanvas.id = tabCanvas.label;
                      tabCanvas.horizontalScrollPolicy = "off";
                      tabCanvas.verticalScrollPolicy = "off";
                                     
                      functionName = new Array(setFunc);
                      paramString = new Array(searchString);
                     
                      matrixLoader = new SWFLoader();
                      matrixLoader.minHeight = 100;
                      matrixLoader.minWidth = 100;
                      matrixLoader.percentWidth = 100;
                      matrixLoader.percentHeight = 100;
                      matrixLoader.addEventListener(FlexEvent.UPDATE_COMPLETE, created);
                      matrixLoader.load(swfURL);
                     
                      tabCanvas.addChild(matrixLoader);
                      tabnavi.addChildAt(tabCanvas,tabnavi.numChildren);
                  }

       

                  public var loadedSM:SystemManager;
                  private function created(event:FlexEvent):void {
                      loadedSM = new SystemManager();
                      if (matrixLoader.content != null) {
                          loadedSM = SystemManager(matrixLoader.content);
                         
                          if (loadedSM.application != null) {
                              for(var i:int = 0; i < functionName.length; i++){
                                  loadedSM.application[functionName[i].toString()] = paramString[i].toString();
                              }
                          }
                      }
                    }

       

      Any help would be greatly appreciated.