4 Replies Latest reply on Apr 3, 2017 10:16 AM by rezun8

    TypeError: Error #1007: Instantiation attempted on a non-constructor.      at MainGameFile/gameLoop()

    brendenc14282108 Level 1

      Any help? My boxMC is inside of my background(WorldMC) but I get an error saying

       

      TypeError: Error #1007: Instantiation attempted on a non-constructor.

        at MainGameFile/gameLoop()

       

      This is where the code is giving me trouble:

       

        //-----------------------------------

        // -----Box Spawning------------

        //------------------------------------

        //only spawn a box if there are less tan 100 already on screen

       

        {

        // Make a new instance of the box class

        var bx = new WorldMC.boxMC();

        // add the ship to the display list

        addChild(bx);

        //position and rotate the Box

        WorldMC.bx.x = Math.random() * stage.stageWidth;

        WorldMC.bx.y = Math.random() * stage.stageHeight;

        WorldMC.bx.rotation = 40;

        }