1 Reply Latest reply on Sep 29, 2007 8:16 AM by tvtony100

    Load a Flex2 SWF using SWFLoader: #1009 null error

    Megamu
      public function set visualization(vizSWF:String):void
      {
      loader = new SWFLoader();
      try{
      loader.addEventListener(FlexEvent.CREATION_COMPLETE, setVizHandler);
      loader.addEventListener(ProgressEvent.PROGRESS, progressHandler);
      loader.load( vizSWF );
      }catch(error:Error){
      trace("Could not load visualization "+error);
      }
      }

      My progress action fires a bunch, tells me it's loading in.
      Once it's loaded in I get the error, it never fires on creationComplete

      ...
      131072 of 140574
      131072 of 140574
      140574 of 140574
      [SWF] C:\Documents and Settings\lbyron\Desktop\Workspace\Project\bin\Visualization.swf - 283,275 bytes after decompression
      TypeError: Error #1009: Cannot access a property or method of a null object reference.
      at mx.core::UIComponent/ http://www.adobe.com/2006/flex/mx/internal::updateCallbacks()[C:\dev\flex_201_gmc\sdk\fram eworks\mx\core\UIComponent.as:4737
      at mx.core::UIComponent/set nestLevel()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\UIComponent.as:2357]
      at mx.managers::SystemManager/ http://www.adobe.com/2006/flex/mx/internal::addingChild()[C:\dev\flex_201_gmc\sdk\framewor ks\mx\managers\SystemManager.as:1511
      at mx.managers::SystemManager/mx.managers:SystemManager::initializeTopLevelWindow()[C:\dev\f lex_201_gmc\sdk\frameworks\mx\managers\SystemManager.as:2329]
      at mx.managers::SystemManager/mx.managers:SystemManager::docFrameHandler()[C:\dev\flex_201_g mc\sdk\frameworks\mx\managers\SystemManager.as:2214]

      Any clue? The SWF it is loading is a basic Flex app, and runs perfectly fine on its own.

      THANKS!!