1 Reply Latest reply on Jul 2, 2012 4:40 AM by aciam70

    TitleWindow problem

    aciam70 Level 1

      Hi everyone

       

      I'm using Flex Builder 4.5

       

      My project has:

       

      a main application: it calls a module

      a module: it call some components

      a component that has a botton. When I press the button the code is:

          var myPop: PopupCont= PopUpManager.createPopUp(this, PopupCont, true) as PopupCont;

          PopUpManager.centerPopUp(myPop);

       

      When I press the button I have this exception:

      TypeError: Error #1009: Cannot access a property or method of a null object reference.

          at mx.managers::PopUpManagerImpl/http://www.adobe.com/2006/flex/mx/internal::createModalWindow()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\managers\PopUpManagerImpl.as:701]

          at mx.managers::PopUpManagerImpl/addPopUp()[E:\dev\4.5.1\frameworks\projects\framework\src\m x\managers\PopUpManagerImpl.as:400]

          at mx.managers::PopUpManagerImpl/createPopUp()[E:\dev\4.5.1\frameworks\projects\framework\sr c\mx\managers\PopUpManagerImpl.as:229]

          at mx.managers::PopUpManager$/createPopUp()[E:\dev\4.5.1\frameworks\projects\framework\src\m x\managers\PopUpManager.as:139]

          at components.Prova::prova/button1_clickHandler()[D:\Flex4.5\APP\src\components\Prova\prova. mxml:17]

          at components.Prova::prova/___prova_Button1_click()[D:\Flex4.5\APP\src\components\Prova\prov a.mxml:31]

       

       

      I tried to call my popup in the main application and it works fine.

      In this situation it works also the button in my component.

      Why?

      I don't want to add the reference to my popup in main application

      How could I do?

       

      Thanks in advance

      Andrea