2 Replies Latest reply on Jun 3, 2008 2:50 PM by mslinn

    CreatePopUp encounters null nativeWindow error

    mslinn Level 1
      The following short AIR application dies:

      <?xml version="1.0" encoding="utf-8"?>
      <mx:WindowedApplication
      applicationComplete="PopUpManager.createPopUp(this, Window, false);"
      layout="absolute"
      xmlns:mx=" http://www.adobe.com/2006/mxml">

      <mx:Script>
      <![CDATA[
      import mx.managers.PopUpManager;
      import mx.core.Window;
      ]]>
      </mx:Script>
      </mx:WindowedApplication>

      The error is:
      [SWF] Main.swf - 902,561 bytes after decompression
      TypeError: Error #1009: Cannot access a property or method of a null object reference.
      at mx.core::Window/get visible()[E:\dev\3.0.x\frameworks\projects\airframework\src\mx\core\Window.as:897]
      at mx.managers::PopUpManagerImpl/addPopUp()[E:\dev\3.0.x\frameworks\projects\framework\src\m x\managers\PopUpManagerImpl.as:229]
      at mx.managers::PopUpManagerImpl/createPopUp()[E:\dev\3.0.x\frameworks\projects\framework\sr c\mx\managers\PopUpManagerImpl.as:178]
      at mx.managers::PopUpManager$/createPopUp()[E:\dev\3.0.x\frameworks\projects\framework\src\m x\managers\PopUpManager.as:124]
      at Main/___Main_WindowedApplication1_applicationComplete()[C:\work\AirTest\src\Main.mxml:3]
      at flash.events::EventDispatcher/dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.core::UIComponent/dispatchEvent()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\co re\UIComponent.as:9051]
      at mx.managers::SystemManager/preloader_preloaderDoneHandler()[E:\dev\3.0.x\frameworks\proje cts\framework\src\mx\managers\SystemManager.as:2251]
      at flash.events::EventDispatcher/dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.preloaders::Preloader/displayClassCompleteHandler()[E:\dev\3.0.x\frameworks\projects\f ramework\src\mx\preloaders\Preloader.as:434]
      at flash.events::EventDispatcher/dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.preloaders::DownloadProgressBar/timerHandler()[E:\dev\3.0.x\frameworks\projects\framew ork\src\mx\preloaders\DownloadProgressBar.as:1451]
      at mx.preloaders::DownloadProgressBar/initCompleteHandler()[E:\dev\3.0.x\frameworks\projects \framework\src\mx\preloaders\DownloadProgressBar.as:1503]
      at flash.events::EventDispatcher/dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.preloaders::Preloader/dispatchAppEndEvent()[E:\dev\3.0.x\frameworks\projects\framework \src\mx\preloaders\Preloader.as:291]
      at mx.preloaders::Preloader/appCreationCompleteHandler()[E:\dev\3.0.x\frameworks\projects\fr amework\src\mx\preloaders\Preloader.as:442]
      at flash.events::EventDispatcher/dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.core::UIComponent/dispatchEvent()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\co re\UIComponent.as:9051]
      at mx.core::UIComponent/set initialized()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\UIComponent.as:1167]
      at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\3.0.x\frameworks\projects\frame work\src\mx\managers\LayoutManager.as:698]
      at Function/ http://adobe.com/AS3/2006/builtin::apply()
      at mx.core::UIComponent/callLaterDispatcher2()[E:\dev\3.0.x\frameworks\projects\framework\sr c\mx\core\UIComponent.as:8460]
      at mx.core::UIComponent/callLaterDispatcher()[E:\dev\3.0.x\frameworks\projects\framework\src \mx\core\UIComponent.as:8403]

      What is wrong?