Skip to main content
Participant
April 8, 2010
Question

TypeError: Error #1007: Instantiation attempted on a non-constructor. on port to Flex 4

  • April 8, 2010
  • 1 reply
  • 26343 views

I have been porting an app from Flex 3.4.x to 4.0.. I have successfully ported the app and its libraries to flex 4.0 (everything build successfully, all the CSS has the new Namespace stuff added, and warnings are down to the same stuff pre-port).  I've also removed ALL the references to http://www.adobe.com/2006/flex/mx in any of my mxml files... In short I "think" I have moved everything over to the new mx and fx namespaces. But I still get the following error (which never happend in 3.4 or 3.5 with this same app) when I try to run my flex app.

TypeError: Error #1007: Instantiation attempted on a non-constructor. at mx.preloaders::Preloader/initialize() at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::initialize() at mx.managers::SystemManager/initHandler()

At this point I am completely stumped.. anyone have any ideas?

Thanks

Josh

    This topic has been closed for replies.

    1 reply

    Adobe Employee
    April 8, 2010

    It means it couldn't find the class for the downloadprogressbar. Did you

    specify preloader="something" in the app?

    Participant
    April 8, 2010

    I wish it was that easy :-P.. Nope, we don't set a preloader of anykind.. I even did a search for "preload" in my project to see if maybe the libs we are using do, but nope.. the source to the libs we are using don't do anything to the preloader too.

    So I've been walking through the code and this is what seems to be happening..

    1) the app decompresses once (

    [SWF] C:\Perforce\DatranDisplay\Display_AdPlanner\DisplayFlex\DMAR_Flex\bin-debug\DMAR_Flex.swf - 5,150,945 bytes after decompression)

    2) SystemManager.initHandler is called and the isStageRoot = true..

    3) the spark preloader is found and used just fine. (line 1858 of SystemManager.initialize)

    4) it goes on just fine (not failing at line 253 of preloader.Initialize where it tries to set the displayClass = new displayClassName())

    4) The app is decompressed a second time?(

    [SWF] C:\Perforce\DatranDisplay\Display_AdPlanner\DisplayFlex\DMAR_Flex\bin-debug\DMAR_Flex.swf - 562,251 bytes after decompression)

    5) SystemManager.initHandler is called a second time but this time isStageRoot = false

    6) no DisplayClassName is found in SystemManager.initialize so null gets passed into preloader.Initialize and then it blows up at displayClass = new displayClassName() (because this time displayClassName = null)..

    Anyways, I am all ears.. I'll keep debugging, but as of yet I have yet to hit a line of my code before this explosion happens...

    Thanks

    Josh Handel

    Adobe Employee
    April 9, 2010

    It is a bit confusing, but the Application's preloader attribute defines a

    IPreloaderDisplay which becomes the displayClassName for the Preloader

    class.

    You may see additional decompressions as RSLs are loaded. We don't get

    enough data to display the RSL names.

    The default IPreloaderDisplay is one of the mx.preloader classes like

    DownloadProgressBar or SparkDownloadProgressBar. You can run a link-report

    to see if they are somehow not linked into the SWF. You can also use -keep

    and see what is in the ***SystemManager-generated.as file. There should be

    a reference to the IPreloaderDisplay in that generated file.