5 Replies Latest reply on Jun 18, 2007 8:51 AM by ChickenSupreme

    error when using instantiated mxml component in popupmanager


      Im getting the following error when trying to create a popup:

      Error #1007: Instantiation attempted on a non-constructor

      The code looks as follows

      var browserPop:CustomBrowser = new CustomBrowser();
      browserPop.targetType = "file";
      browserPop.fileType = "jpg";
      var pop:TitleWindow = PopUpManager.createPopUp(this,browserPop as Class, true) as TitleWindow;

      Where CustomBrowser is an MXML component extending TitleWindow.

      If i use:

      var pop:TitleWindow = PopUpManager.createPopUp(this,CustomBrowser, true) as TitleWindow;

      it works fine but i need to be able to set some public properties and therefore instantiate it first. Any help would be appreaciated.

      Thanks in advance